Questions about the Editor and how to load the exported saved Scene from c++ code

73 views
Skip to first unread message

Meir Yanovich

unread,
Jan 13, 2014, 5:43:26 AM1/13/14
to urh...@googlegroups.com
Hello 
i now experimenting with the editor and i have few questions 
1. sizes of models , for example when i load the Models/Plane.mdl from c++  and then above it i load my model that its size is: 8.21 meters ( im using the metric units in blender ) 
and the model looks right that is small and above the Plane mesh 

BUT , when i create the Scene in the editor  like this :
create local node 
create staticModel and pick the Plane model 
create local node 
create AnimatedModel and pick my model the one i created in blender  model 

now i see in the editor , that the model is way to big then the plan and i have to scale it down or scale up the plane by 20 units in the editor 
why is that ? 

2. i create camera in the editor and i like to in the editor to be able to View the Scene via the camera i created how can it be done ? 

3. i want to be able to load the exported xml via c++ code not the script , do i need to port the NinjaSnowWar.as script to c++ 
if yes what should i avoid or look for ?
if not and there is c++ example where can i find it ? 

Thanks 

Lasse Öörni

unread,
Jan 13, 2014, 6:37:41 AM1/13/14
to urh...@googlegroups.com
2. Camera preview in editor is not implemented.

3. Look at the 11_Physics C++ example, which saves the scene with F5 key and loads it with F7. You need to first have your scene object created, then you can load an xml scene file to it with the LoadXML() member function.

Message has been deleted

Meir Yanovich

unread,
Jan 13, 2014, 7:16:08 AM1/13/14
to urh...@googlegroups.com
Thanks for the answers , 
now i have new question .
is there way to build the scene in the Editor and then somehow to extract the data to c++ code instead of loading this big xml ? 
i think this option will be very usefull

Lasse Öörni

unread,
Jan 13, 2014, 7:24:17 AM1/13/14
to urh...@googlegroups.com
There is already binary serialization, which should be used if XML loading presents performance problems.

Meir Yanovich

unread,
Jan 13, 2014, 8:05:18 AM1/13/14
to urh...@googlegroups.com
 i think that to have the option to export source code of the scene it very big time saver 
i can think about many uses for this option for example 
say you want to load the scene and do some function in between the loading of the final scene , keep the creation more dynamic .
if i had the source code of the scene it will save me allot of time . 

weitjong

unread,
Jan 13, 2014, 8:25:06 AM1/13/14
to urh...@googlegroups.com
What happen when you want to edit the scene further after you have serialized it into "source code"? Do you expect Editor be able to scan/parse/compile the "source code" back into a scene?

Current serialization/deserialization, either in binary or XML format, offers a round trip editing for Editor.

Lasse Öörni

unread,
Jan 13, 2014, 8:32:38 AM1/13/14
to urh...@googlegroups.com
If you want to intercept the scene loading, you can subscribe to NodeAdded, ComponentAdded etc. events (see SceneEvents.h) that it sends while loading. That is actually how the editor populates its edit UIs.

However I would guess that in 99% of cases you are able to do whatever you need to do after the scene has completely loaded. Eg. find a scene node by name and do something to it.

Meir Yanovich

unread,
Jan 13, 2014, 8:44:09 AM1/13/14
to urh...@googlegroups.com
Thanks for replay , 
No i don't expect any option for the editor to parse the source code again 
its just function  to save time once i placed the scene . 
Reply all
Reply to author
Forward
0 new messages