XPlane2Blender icon indicating copy to clipboard operation
XPlane2Blender copied to clipboard

Mesh as Root Bone's Blender Object does not get properly transformed

Open KarlLeclerc opened this issue 5 years ago • 7 comments

Hi Ted. For some reason, the transform rotation angles in all three axis seem to get lost in the export process.

I am new to Blender and to using the export script. I can create objects in Blender, export them and have the files properly created in the project aircraft folders. I can link the object files to the aircraft in Planemaker. That all seems to work fine. However, once in Planemaker, all the exported objects point strait up, in the same direction. None of the angles of rotation on any of the 3 axis in the transform box seem to export with the object. Turning an object 90 deg on any axis and re-exporting has no impact on the object in Planemaker for example, still pointing up. This is not for an animation; just a static object.

It could be your script, or the guy behind my keyboard that needs to be educated... Thanks for anything you can offer.

Karl

Versions: Blender 2.83, XP2B 4.0.0b2, Planemaker 11.50b13, MacOS 10.15.5

KarlLeclerc avatar Jul 08 '20 05:07 KarlLeclerc

I'd love to hear the answer to this as well. (I'm also a Noob to Blender and a Mac user, although I'm still at OS 10.13.16.

My workflow is bringing .fbx or .obj files out of Fusion 360, into Blender 2.83 and into PlaneMaker 11.50b13 with the xPlane2Blender plugin.)

Karl - There is an "Apply" function in Blender which I think needs to be set before saving and exporting the Blender object.

Are you doing that? Ted; Is that correct?

DWmFrancis avatar Jul 08 '20 15:07 DWmFrancis

Karl - There is an "Apply" function in Blender which I think needs to be set before saving and exporting the Blender object.

Thanks DWmFrancis,

Yes, it took a while to find it, and it worked. Blender definitely not the friendliest thing to learn. One of these days, someone will explain why you have to "apply" the transformations twice to the object for them to export. There is probably a very nebulous situation where someone would not want it done in one simple operation... maybe it should be a preference setting.

Thanks to your plugin Ted, this confirmed that the workflow is workable/feasible. Still not sure about Blender user-friendliness. I will now have a look at AC3D before deciding which tool I will use for the next couple of years...

KarlLeclerc avatar Jul 09 '20 03:07 KarlLeclerc

XPlane2Blender should be completely What You See Is What You Get. If that isn't happening, then there is a bug.

Blender keyframing does have something annoying - if Autokeyframe isn't on then you have to insert a keyframe everytime you make a rotation or location change. If you change frame numbers then it doesn't save it for you. I recommend setting Auto Keyframing to true.

If this doesn't explain it, can you post a small .blend file that shows the problem or not exporting without hitting Apply? (Obviously in its pre-hitting-apply-state?)

tngreene avatar Jul 09 '20 19:07 tngreene

@KarlLeclerc As a warning AC3D is not (as far as I know) maintained by anyone. Its open source of course, but, do you want to make art or an exporter?

I highly recommend Blender instead, for a variety of other reasons as well. Though I do acknowledge the high learning curve.

tngreene avatar Jul 09 '20 19:07 tngreene

Hi Ted.

I intend to develop a quality helicopter for X-Plane. Thanks for the info. I will keep all the above in mind for sure. I have to learn one, and I am not biased towards one, or the other. I just want to have a good idea before I start production.

Not quite WYSIWYG. The following Blender file should suffice to illustrate. It contains a simple cylinder that has been pointed at one end with a flat section. To illustrate that the transforms (location, rotation and scale) are not being exported, I have move the cylinder 3 meters on the X axis, rotated it 90 degrees on the X axis, and scaled it 50% on the X axis as well. Note the corresponding data has already been inputted in the transform data box.

If you export the file (as is) as an X-Plane object, it will create a Cylinder.obj file. Attach the exported file as a Misc Object to any aircraft in Planemaker and note the orientation of the object. None of the changes in location, rotation and scaling have been applied, which will become more obvious after the following comparative object file is produced.

Go back to the Blender file, select the cylinder, goto Object/Apply and select All Transforms. You will notice that all the location, rotation and scaling data gets zeroed in the box. Export it again and re-attach the new object file to the plane in Planemaker. This time, all the transforms (location, rotation and scaling) have exported, and the cylinder is in a different location, pointing in a different direction, and scaled in one axis.

I hope this helps. Thanks again for you time.

Karl

ApplyTest.blend.zip

KarlLeclerc avatar Jul 09 '20 21:07 KarlLeclerc

You've discovered a bug (that I forgot about, thank you!)

The short answer is: It appears that XPlane2Blender doesn't properly tranform a mesh if that mesh is the root.

When you mark something as "Root Object" or "Root Collection" you're saying to the exporter "Start here, and make a hierarchy out of all the children". That "place to start" is the root, and it appears we don't rotate it properly.

The fix: Use Root Collections or make an empty the root object with your cylinder as a child. I just tried both and they both worked.

tngreene avatar Jul 09 '20 21:07 tngreene

Glad to read that you are all over it Ted. My testing to check the feasibility of my workflow was limited, so I guess I ran into it by accident... I am highly impressed and encouraged by your responsiveness. Cheers.

KarlLeclerc avatar Jul 09 '20 21:07 KarlLeclerc