About Leadwerks 3D World Studio Exported Map
Community Forums/Developer Stations/About Leadwerks 3D World Studio Exported Map
| ||
Is it possible to call an UpdateNormals recursively for a 3D World Studio exported b3d map. I tried this but it's giving me a memory access violation. Function UpdateNormalsRecursive( entity ) UpdateNormals entity For c = 1 To CountChildren( entity ) UpdateNormals GetChild( entity, c ) Next End Function |
| ||
Try something like this:Function UpdateNormalsRecursive( entity ) If EntityClass(entity) = "Mesh" UpdateNormals entity EndIf For c = 1 To CountChildren( entity ) UpdateNormalsRecursive GetChild( entity, c ) Next End Function |
| ||
It doesn't produce any errors but it doesn't update any normals I think. Even it's in B3D format, doesn't 3D World Studio maps have normals? I'm trying to get Swift Shadow System to cast shadows on 3dws maps with no success. |
| ||
It is probably updating the normals but the materials in the b3d file use lightmaps or vertex colors, so they won't work with hardware lights. |
| ||
Possibly you are trying to update normals on a pivot or non mesh?? More like this mabe? Function RecursivePropertyUpdate(h) If EntityClass(h)="Mesh" entityfx h,0 updatenormals h EndIf For cc=0 To CountChildren(h) chi=GetChild(h,cc) If chi RecursivePropertyUpdate(chi) Next End Function Lightmapping/fullbright could be another problem EDIT: lol, ok fredborg got there first (by 3 days! :P) teach me not to post and scanread when in a real rush. Still, what happens when you include the entityFX not to fullbright + vertex color into the mix, (added to code=) |
| ||
Oh I forgot to post that I've sorted out the problem. My bad. I also used fredborg's code for a start. Thanks everyone. |