Bug exporting object bounds?
2 posters
Bug exporting object bounds?
Hello,
I think I've found an issue with exporting the object bounds type. I noticed my static objects were coming in as a trimesh even though I specified a sphere or cube. Then I noticed that my ridged body objects didn't have a bounds tag in the sio2 file. So I tweaked the exporter:
Here's the original code:
And here's the same bit with my changes:
I also deleted bounds = 4 from a few comment blocks up.
I think the problem with the previous code was that "if(bounds)" wasn't setting bounds for cubes because if(0) is a no-op. I looked around for where bounds was being initialized and the only place I found was during the sio2 file loading. I didn't find any defaults so this might cause something unexpected.
The other problem was that the bounds shape for my static objects wasn't being set.
Please let me know if what I did breaks something else.
Thanks.
-Greg
I think I've found an issue with exporting the object bounds type. I noticed my static objects were coming in as a trimesh even though I specified a sphere or cube. Then I noticed that my ridged body objects didn't have a bounds tag in the sio2 file. So I tweaked the exporter:
Here's the original code:
- Code:
#====================================
# OBJECT BOUNDS
#
# 0 - Cube
# 1 - Sphere
# 2 - Cylinder
# 3 - Cone
# 4 - Static Triangle Mesh
# 5 - Convex Hull Polytope
#
#====================================
if( obj.rbFlags & Object.RBFlags[ "ACTOR" ] and
obj.rbFlags & Object.RBFlags[ "DYNAMIC" ] ):
bounds = obj.rbShapeBoundType
if( obj.rbFlags & Object.RBFlags["RIGIDBODY"] and
bounds != 4 ):
mass = obj.rbMass
if( obj.rbFlags & Object.RBFlags["SOFTBODY"] ):
if( bounds != 4 or bounds != 5 ):
bounds = 4
mass = obj.rbMass
if( bounds ):
buffer = "\tbounds( %s )\n" % bounds
f.write( buffer )
And here's the same bit with my changes:
- Code:
bounds = None
if( obj.rbFlags & Object.RBFlags[ "ACTOR" ] ):
if( obj.rbFlags & Object.RBFlags[ "BOUNDS" ] ):
bounds = obj.rbShapeBoundType
else:
bounds = 4
if(obj.rbFlags & Object.RBFlags[ "DYNAMIC" ] ):
if( obj.rbFlags & Object.RBFlags["RIGIDBODY"] and
bounds != 4 ):
mass = obj.rbMass
if( obj.rbFlags & Object.RBFlags["SOFTBODY"] ):
if( bounds != 4 or bounds != 5 ):
bounds = 4
mass = obj.rbMass
if( bounds is not None ):
buffer = "\tbounds( %s )\n" % bounds
f.write( buffer )
I also deleted bounds = 4 from a few comment blocks up.
I think the problem with the previous code was that "if(bounds)" wasn't setting bounds for cubes because if(0) is a no-op. I looked around for where bounds was being initialized and the only place I found was during the sio2 file loading. I didn't find any defaults so this might cause something unexpected.
The other problem was that the bounds shape for my static objects wasn't being set.
Please let me know if what I did breaks something else.
Thanks.
-Greg
gtmacdonald- Posts : 9
Join date : 2008-12-11
Re: Bug exporting object bounds?
Hummmmmm this is what I got into the exporter at the moment maybe a little bug slipped in...
- Code:
#====================================
# OBJECT BOUNDS
#
# 0 - Cube
# 1 - Sphere
# 2 - Cylinder
# 3 - Cone
# 4 - Static Triangle Mesh
# 5 - Convex Hull Polytope
#
#====================================
if( obj.rbFlags & Object.RBFlags[ "ACTOR" ] and
obj.rbFlags & Object.RBFlags[ "DYNAMIC" ] ):
bounds = obj.rbShapeBoundType
if( obj.rbFlags & Object.RBFlags["RIGIDBODY"] or
obj.rbFlags & Object.RBFlags[ "DYNAMIC" ] and
bounds != 4 ):
mass = obj.rbMass
if( obj.rbFlags & Object.RBFlags["SOFTBODY"] ):
mass = obj.rbMass
if( bounds != 4 or bounds != 5 ):
bounds = 4
if( bounds ):
buffer = "\tbounds( %s )\n" % bounds
f.write( buffer )
Similar topics
» exporting two sides of object
» Exporting EMPTY Objects From Blender
» Exporting "Empty" Object Types from Blender
» I need help exporting
» Exporting large meshes
» Exporting EMPTY Objects From Blender
» Exporting "Empty" Object Types from Blender
» I need help exporting
» Exporting large meshes
Permissions in this forum:
You cannot reply to topics in this forum