Blender+Chicken: Flipped normals?

Hello there. I am new to Panda, but not new to 3d engines or game programming.

I am, however, new to both Panda’s art pipeline and to Blender.

Currently I am working on a simple bipedal model to teach me about the basics of Blender, such as UV mapping and bone weighing.

I am a bit stumped, though.

I have successfully exported my UV-mapped model into pview using Chicken, but the normals appear to be flipped. It looks fine in Blender, but is inside-out when viewed in pview.

But if I reverse the normals in Blender, then the model reverses itself during the export process! It looks fine in pview, but is inside-out in Blender.

It’s almost like I have somehow got the winding order reversed in Blender. My model started out as a combination of independent meshes which I duplicated and mirrored to generate the current (combined) mesh, so I fear my mistake lies somewhere in there.

I have tried just having Blender re-calculate the normals (using edit/Ctrl-N), but it results in a mesh that looks fine in Blender but is inside-out in pview.

Anyone have any ideas how I can fix this?

Note: This only applies to my bipedal mesh. If I create, say, a new box as a separate mesh and export it along with my bipedal character, it works fine.

Moderators: Uhhh, I swore I was in the Pipeline folder when I created this topic. Can it please be moved?

hi, welcome to panda.
did you use some mirror-modifier or did you apply some negative scale to the model?

Thanks for the welcome. I am very excited about working with Panda3d, as I love Python so it’s a good fit. :slight_smile:

I just found out that I had a negative scale applied to my object! Doh, that explains why it was acting as if the winding order was reversed. Resetting the scale (and then modifying the mesh to match the orientation I wanted) fixed it.

I see now that there is an extra object transform being applied inside of Blender, but gets dropped when the mesh is exported. (Explains why the object was inverted in Blender but fine when exported.)

Still learning Blender, so didn’t realize that meshes are entirely separate coordinate spaces from objects.

Now I know… Thanks for the assist. :slight_smile:

For the future reference, if you have this issue and are finding this thread via search: Check your object properties! (Press N when in object mode.) If your scale is negative on any axis, then you will have similar issues. Be careful when mirroring objects using the duplicate command, as crossing an axis will by default invert the scale axis.

Ok, so i’ve googled this thread, having run into the same problem.
I am very uninformed on how the guts of these things work…

Suppose that I have spent a reasponable amount of time making something like a reasonable left leg. I’d like a right leg that is, well… Identical, but opposite.

Duplicate/mirror the object seems obvious, but it is infact applying -scale.

How can I infact duplicate and mirror an existing object (in blender) without getting the negative scale effect.

I un-applied the scale which effectively de-mirrored the thing.
Any help would be greatly appreciated!


EDIT: It seems that if I duplicate the object, and then go to edit mode and select all verticies, and mirror global/local/view those, than they flip. Go back to object mode, and the object is still pos scale. However, when I export this out to chicken, panda still renders it “inside out” :frowning:

Duplicate the object, mirror it, then apply the mirror modifier in the modifier stack. You might then need to correct the normals after applying the modifier, but I don’t think you do. Alternatively you can just apply a negative scale and then their is an ‘apply transformation to vertices’ operation, which achieves the same effect. though you will defiantly have to fiddle with surface normals after doing that. Can’t for the life of me remember where that operation is hidden though. You can also apply a negative scale in edit mode - then its applied to the vertices directly rather than the object transform panel.

I have nothing to add, but here’s another tip.

Make sure you get this all straightened out BEFORE you start animating. :slight_smile: I didn’t realize I had my biped facing backwards in Blender wrt Panda’s coordinate system of Y-forward. I flipped him, but now my animations are animating backwards!

Okie, seems like if you do this, it works…

make some object, say right side.
object mode: duplcate, then drag it over a bit
edit mode / select all verts
mesh / mirror however (x global)
mesh / normals / recalculate outside

That seems to do it.

I guess that’s blender 2.45