. You guys might know I was wanting to use my bafang rear retro blade wheel with a new rear hub motor I’ll post a pic !
If you mean the cast (nonspoked) wheel in the second pic, you can't directly use a different hubmotor in it because it's motor casing is cast as part of the wheel.
You'd need to machine the motor casing of any new motor so that it fits inside the existing casing that's part of the wheel, and then bond or otherwise secure them together so it can't rotate inside that.
Or you'd need to pick a motor that uses essentially the same casing, so that you can take it's core out of it's own casing and install it into this one (or is close enough to machine parts to make it fit).
If the casing is the same internal diameter, and same internal width, so the core fits including axle shoulders, etc., and if the outer ring gear (the one in the hub shell) is the same as the new motor's, it should just slip in and then use the side cover off the old motor to close it up (unless the new motor's fits onto and bolts down to the old mtoor's casing; which could happen but may not).
If all the above is true but the ring gear is different, you should be able to move the ring gear from the new motor's casing to the old one; it may require some machining of the casing or gear to fit the keyway/key together so the gear can't spin inside the housing.
Structurally you can't really cut the original casing out and install a new one; there might be ways to machine parts to secure the cast "spokes" to the casing, but unless you *really* want that wheel you're likely to find it better (cheaper, easier, etc) to just build the type of wheel the new motor is designed to fit in.