Crystal Space
Welcome, Guest. Please login or register.
October 26, 2014, 02:27:53 am

Login with username, password and session length
Search:     Advanced search
9011 Posts in 2044 Topics by 8828 Members
Latest Member: Saikjanna
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Would like help loading model from library
« previous next »
Pages: [1] Print
Author Topic: Would like help loading model from library  (Read 2560 times)
koocake
Jr. Member
**
Posts: 54


View Profile
« on: January 20, 2006, 12:59:07 pm »

Hi there,

I am using blender to create levels and models. I have successfully used the blender2crystal blender plugin script to export a level, which I can then load and look round with walktest.

What I havent been able to do is to display a model that has been exported as a library using blender2crystal.

I read somwhere in the crystal space manual:

 Making Models

Models of type Genmesh (see section Genmesh Mesh Object) can also be converted directly with Blend2cs or blender2crystal. To do this you need to mark the object in Blender as a genmesh object (see manual on how to do that) and then export as a library. In Crystal Space you can directly load that library as a single model.


I would like to know how I can directly load that library as a single model.

An example code snippet would be really helpful, I've been stuck on this for a while!

regards, Kate Mallichan

Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: January 20, 2006, 01:03:21 pm »

Hi there,

I am using blender to create levels and models. I have successfully used the blender2crystal blender plugin script to export a level, which I can then load and look round with walktest.

What I havent been able to do is to display a model that has been exported as a library using blender2crystal.

I read somwhere in the crystal space manual:

 Making Models

Models of type Genmesh (see section Genmesh Mesh Object) can also be converted directly with Blend2cs or blender2crystal. To do this you need to mark the object in Blender as a genmesh object (see manual on how to do that) and then export as a library. In Crystal Space you can directly load that library as a single model.


I would like to know how I can directly load that library as a single model.

An example code snippet would be really helpful, I've been stuck on this for a while!

regards, Kate Mallichan



iBase* result;
iLoader->Load ("/bla/mylibrary", result);

Greetings,
Logged
koocake
Jr. Member
**
Posts: 54


View Profile
« Reply #2 on: January 20, 2006, 01:11:48 pm »

I had got this far, but am unsure how to go from here to actually display the model in a level?

thankyou so much for your help,

Kate Mallichan
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #3 on: January 20, 2006, 01:23:32 pm »

I had got this far, but am unsure how to go from here to actually display the model in a level?

thankyou so much for your help,

Kate Mallichan

Ah ok. That's something else from loading smiley

After loading the model from the library it will have created a mesh factory with some name (the name you gave it in Blender). To find that do:

iMeshFactoryWrapper* factory = engine->FindMeshFactory ("somename");

Then you can create a mesh from that:

csRef<iMeshWrapper> mesh = engine->CreateMeshWrapper (factory, "bla", sector, csVector3 (x, y, z));
mesh->GetMovable ()->UpdateMove ();


That's it. For more information check out the simple2 tutorial in the manual. Some of these concepts are explained there too.

Greetings,
Logged
koocake
Jr. Member
**
Posts: 54


View Profile
« Reply #4 on: January 20, 2006, 01:57:27 pm »

Ok, im getting there...

I now get errors similar to following for each texture, even though these files are present.

  Could not open image file 'textures/outUVwingmirror.jpg' on VFS!

I also get an error

crystalspace.maploader.parse.library:  Could not open library file 'factories/thingpolySurface9' on VFS!

for this one particular mesh, but not for the others (there are several in the library).

Any clue as to why this is happening?

thanks again for your help,
Kate Mallichan
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #5 on: January 20, 2006, 02:01:07 pm »

Ok, im getting there...

I now get errors similar to following for each texture, even though these files are present.

  Could not open image file 'textures/outUVwingmirror.jpg' on VFS!

I also get an error

crystalspace.maploader.parse.library:  Could not open library file 'factories/thingpolySurface9' on VFS!

for this one particular mesh, but not for the others (there are several in the library).

Any clue as to why this is happening?

thanks again for your help,
Kate Mallichan


That path looks wrong. You must use VFS paths. So probably you want to add /this in front of it. i.e. /this/textures and /this/factories

/this is the current directory in VFS.

Greetings,
Logged
koocake
Jr. Member
**
Posts: 54


View Profile
« Reply #6 on: January 20, 2006, 02:44:16 pm »

Thankyou very much, the models display nicely now Smiley
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 5.488 seconds with 15 queries.