Hello.
I am writing a Blender Import/Export for a new file format, alone with a series of blender scripts to inject physics and graphics properties to a Graphic scene.
The idea is as follow
-Import Graphics scene
-Edit scene, adding properties
-Export modified Scene.
However I am having a problem that does not seem to go away.
When I import me graphics Scene only few object show on eh screen, I have to move the mouse of select the object in the scene so that they become visible.
I can no determine what I am doing wrong since the scene seems to load fine. And also it seems to happen with scene with more than one root model.
This is the function than loads the scene.
#
# implement main scene loader function
#
def LoadAlchemediaScene(filename):
''' Load a newton Alchemedia file '''
scene = pyScene.pyScene()
scene.Load (filename)
root = scene.GetRoot()
# get the active blender scene
blenderScene = bpy.data.scenes.active
# load all unique textures
(path, name) = os.path.split (filename)
childLink = scene.GetFirstChildLink (root)
while childLink != None:
textureNode = scene.GetNodeFromLink(childLink)
if scene.IsTextureNode(textureNode) == True:
texture = CreateBlenderTextureFromNode (scene, textureNode, blenderScene, path)
# add a map key for asigning faces
sourceTexture = pyScene.pyTexture(scene, textureNode)
g_textureMap[sourceTexture.GetId()] = texture
childLink = scene.GetNextChildLink (root, childLink)
# import all objects into a blender scene
myChidren = []
childLink = scene.GetFirstChildLink (root)
while childLink != None:
node = scene.GetNodeFromLink(childLink)
if scene.IsSceneNode(node) == True:
LoadNodesScene(scene, node, blenderScene, myChidren)
childLink = scene.GetNextChildLink (root, childLink)
# make sure everthing is updated before exiting
# I see this in some demos, but nthing seeme to makes the scene render completly
blenderScene.update(1)
Blender.Redraw()
The Plug-in can be downloaded here
http://www.newtondynamics.com/downloads/AlchemdiaBlender.rar
It is possible that Blender do no support more than on root object in the scene.
I noticed that this happen when I have multiple root objects.
I also have few other questions but If someone can tell me what I need to do to fix this problem, I can continue and I can probably figure out myself.