-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for exporing SkyBoxes #239
Conversation
top = mathutils.Euler((math.radians(180), 0, 0), 'XYZ') | ||
bottom = mathutils.Euler((0, 0, 0), 'XYZ') | ||
|
||
orientations = {"fr": front, "bk": back, "rt": right, "lf": left, "up": top, "dn": bottom} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should rather use the alternative naming conventions, as those are clearer:
https://github.com/OGRECave/ogre/blob/6bcf1d7d4c510104f794d779e63d330c2c8d5ebb/OgreMain/src/OgreTexture.cpp#L35
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean this ones: "_px", "_nx", "_py", "_ny", "_pz", "_nz"
?
scene.render.image_settings.file_format = 'PNG' | ||
|
||
# Create SkyBox camera orientations | ||
front = mathutils.Euler((math.radians(90), 0, 0), 'XYZ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are the orientations used internally by Ogre:
https://github.com/OGRECave/ogre/blob/6bcf1d7d4c510104f794d779e63d330c2c8d5ebb/OgreMain/src/OgreCompositorChain.cpp#L267
the blender orientations might be different due to axis flipping. Maybe we should disable axis flipping when it comes to .scene contents altogether for simplicity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I'll see how to acomodate the axis swapping with this.
In my opinion the current systems works good, because when you export a .scene what you get is what you see in Blender. Things have the "same" position and orientation, at least visually. And to me and probably most people (I guess) that is the most intuitive output.
Besides this exporter has worked like that for a loong time.
The only issue is that by default lights in Blender point towards the "bottom" or down while in OGRE by default they point towards the "back" of the screen, so they need a correction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. I'll see how to acomodate the axis swapping with this.
I just drew the results of axis swapping, and they are just all rotations. So you should be able to use orientation parameter of the skybox.
Besides this exporter has worked like that for a loong time.
I think it has never worked correctly :P see #240 where I tried to explain the issue in detail
This solves #203