Jump to content

Unity Adding Bad Transform and Rotation to Sun Panel Model


Recommended Posts

For some reason, either Unity or the FBX export is adding a weird transform into my model. I've made animations before without a problem. The only difference is that I'm using an Empty "game object" in Blender upon which to create the model. I'm doing this to make solar panels which is kind of convoluted. You must place the panels on a specific local Z-axis in order to track the sun correctly. This model does track the sun correctly after deployment.

I've provided a link to my Blender file below, with textures and FBX export file.

MODULE

{

name = ModuleDeployableSolarPanel

animationName = Scene

resourceName = ElectricCharge

sunTracking = true

raycastTransformName = panel

pivotName = panel

chargeRate = 1

powerCurve

{

key = 206000000000 0 0 0

key = 13599840256 1 0 0

key = 68773560320 0.5 0 0

key = 0 10 0 0

}

}

Revised Blender file

Blender image. The manipulator is showing LOCAL (not global transforms).

xSfLczr.pngozOw33u.png

From Blender. How the sequence is supposed to appear:

zZiPunS.pngOo146Rf.pngzZiPunS.pngWNpsynt.pnghpxgw32.png

How it appears in Unity and KSP (in KSP, it has correct textures and material):

In the fourth image, the panel is straight down. It then rotates (image 5). It then rotates on its center axis and rotates up to the left before rotating into the final, correct position.

3XUlCxE.pnguXzMbLm.pngfVwL7bw.pngB7X4fu2.pngECFOjF0.pngd278jLZ.pngTEMcipI.pngtMDrVLf.png

What am I doing wrong?

Edited by Apollo13
Link to comment
Share on other sites

It's already set to Quaternion. I guess I'll try Euler.

EDIT: I just tried Euler and Quaternion. the Unity video preview window still showed the erroneous animation. Was I supposed to Save something before exiting the Animation window?

Also, there was no individual interpolation like your example. There was an interpolation for "panel: rotation"

qRbcC0o.png

Edited by Apollo13
Link to comment
Share on other sites

ok I see what's the issue;

you have scale keys in there. from a different angle, you can see the moving part is not bending down, but becoming super stretched in one direction. it's because you didn't reset your scales on the pieces. Scrubb through the animation and you will see the scales changing drastically. You have to reset the scales on the pieces in Blender to 1 or 100%, then key the animation and export.

lh0lJvO.jpg

Edited by nli2work
Link to comment
Share on other sites

When I set the X and Y scales to 1.0 in Blender, the plane becomes a 2x2 square. I don't want a 2x2 square. I tried locking scaling and changing the Dimensions; the Scaling changed anyway.

I rekeyed using LocRot and LocRotScale; none of those changed the outcome. the scaling doesn't change in Blender; only in Unity.

this is frustrating....................

Edited by Apollo13
Link to comment
Share on other sites

Yeah, I just discovered and tried that a few minutes ago. No joy. I cleared all keyframes. I then rekeyed (Location, rotation).

I'm trying to put into practice what you provided previously.

Here's the FBX file that was created and I imported to Unity:

FBX file

Revised Blender file with textures

Edited by Apollo13
Link to comment
Share on other sites

I exported from the blender file and the FBX still contains key frames in scale, even though in the blender scene it looks like there are only position and rotation key frames. I don't know why it is this way, but it's something that needs to be fixed in Blender before export. I don't know enough blender to help on that side. there's a "Dimensions" in Blenders, that sounds like a local scale or something. You need to get all the pieces such that when imported to Unity, their scales are all 1,1,1 when childed to the world. I would break all the pieces out of the heirarchy and reset their scales and dimensions to 1; edit the polygons to the shapes you need. then reconstruct the heirarchy, key the animation and export.

Link to comment
Share on other sites

OK. I'll give that a try. I just don't understand why Blender is adding these deformations. I sure as hell didn't add them.

Unfortunately, I must be away from my computer until Saturday, so I'll experiment on Sunday.

Thank you to you and raidernick for your patience and assistance.

Link to comment
Share on other sites

I just realized that "Dimensions" section probably means the pieces are still primitives instead of polygons. In Max there's option to convert a primitive (box, sphere, etc) to editable polygons, it's good idea to convert all primitives to polygons before exporting.

Link to comment
Share on other sites

In Blender, those are polygons. When you go into Edit mode, you can view and modify the individual polygons that shapes are made from, including faces, edges, and vertices. "Dimensions" are the size of the part in Blender units.

It's frustrating that Blender is adding those deformations during export to FBX.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...