Resources - Assets and Instances
2 posters
Resources - Assets and Instances
I'd like to export a scene where I use the assets (textures, materials, meshes, collision surfaces, animation tracks) but not the object instances. I'd like to create instances at run-time with references to the meshes... is there a way to do that?
Cobbler- Posts : 15
Join date : 2009-02-01
Re: Resources - Assets and Instances
You can always use sio2ObjectDuplicate, or you can link the iname dynamically and then link the instance...
Cheers,
Cheers,
Re: Resources - Assets and Instances
That's cool. My problem, however, is that as I extract the .sio2 file it automatically creates the object instances. How do I avoid that?You can always use sio2ObjectDuplicate, or you can link the iname dynamically and then link the instance...
Cobbler- Posts : 15
Join date : 2009-02-01
Scene with just assets, no instances
I have to bump this...
How do I create a scene with just assets, no instances, so that when I extract all the resources no objects are created in the scene and nothing is rendered?
How do I create a scene with just assets, no instances, so that when I extract all the resources no objects are created in the scene and nothing is rendered?
Cobbler- Posts : 15
Join date : 2009-02-01
Re: Resources - Assets and Instances
Sorry I think I read your question a bit too fast.... can you give me more info. about exactly what you want to do...
Re: Resources - Assets and Instances
OK... let's see if I can explain this
I want to create a Blender-scene with some textured meshes, let's say they are going to be used for pickups. I export to 'pickups.sio2'.
Then I want to load and extract the data doing something like this:
Now, I don't want anything to be rendered yet, I only want meshes, materials and textures, no objects of any kind.
Last, I want to create and destroy pickups during run-time using the various meshes.
I hope that describes the problem...
I want to create a Blender-scene with some textured meshes, let's say they are going to be used for pickups. I export to 'pickups.sio2'.
Then I want to load and extract the data doing something like this:
- Code:
sio2ResourceCreateDictionary(m_SIO2resource );
sio2ResourceOpen(m_SIO2resource, name, 1);
if( m_num_extracted<m_SIO2resource->gi.number_entry )
{
sio2ResourceExtract( m_SIO2resource );
++m_num_extracted;
}
sio2ResourceClose(m_SIO2resource );
sio2ResourceBindAllImages(m_SIO2resource);
sio2ResourceBindAllMaterials(m_SIO2resource);
sio2ResourceBindAllInstances(m_SIO2resource);
sio2ResourceBindAllMatrix(m_SIO2resource);
sio2ResourceBindAllPhysicObjects(m_SIO2resource, sio2->_SIO2physic );
sio2ResourceGenId(m_SIO2resource );
Now, I don't want anything to be rendered yet, I only want meshes, materials and textures, no objects of any kind.
Last, I want to create and destroy pickups during run-time using the various meshes.
I hope that describes the problem...
Cobbler- Posts : 15
Join date : 2009-02-01
Re: Resources - Assets and Instances
dude I still don't get it... that pickup thing... just give a concrete scenario used in a game...
Re: Resources - Assets and Instances
That is a concrete example. Pickups, you know, stuff the player picks up
o I create a Blender scene with one monkey head in it (Suzanne), put a material on the head with a texture
o I export to a SIO2 file
o I run the game
o I load the SIO2 file and extract the resources
o I see a monkey head in my scene
* I don't want to see the monkey head in the scene
* I want to find the mesh by using sio2ResourceGet() and create an instance by creating a SIO2object()
In other words I don't want the scene layout, object positions, or whatever else you want to call it, from the SIO2 file
o I create a Blender scene with one monkey head in it (Suzanne), put a material on the head with a texture
o I export to a SIO2 file
o I run the game
o I load the SIO2 file and extract the resources
o I see a monkey head in my scene
* I don't want to see the monkey head in the scene
* I want to find the mesh by using sio2ResourceGet() and create an instance by creating a SIO2object()
In other words I don't want the scene layout, object positions, or whatever else you want to call it, from the SIO2 file
Cobbler- Posts : 15
Join date : 2009-02-01
Re: Resources - Assets and Instances
Just tag them as ghost, after that duplicate the ones that you want to put visible that's all... and you can use dynamically created triggers to check if the player pick it up or not...
Similar topics
» Custom resources
» rendering multiple resources
» Using Multiple Resources and sio2 files
» Pull from Documents folder instead of Resources folder
» rendering multiple resources
» Using Multiple Resources and sio2 files
» Pull from Documents folder instead of Resources folder
Permissions in this forum:
You cannot reply to topics in this forum