FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Resources - Assets and Instances

2 posters

Go down

Resources - Assets and Instances Empty Resources - Assets and Instances

Post  Cobbler Wed Feb 04, 2009 5:37 pm

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

Back to top Go down

Resources - Assets and Instances Empty Re: Resources - Assets and Instances

Post  sio2interactive Wed Feb 04, 2009 6:28 pm

You can always use sio2ObjectDuplicate, or you can link the iname dynamically and then link the instance...

Cheers,
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Resources - Assets and Instances Empty Re: Resources - Assets and Instances

Post  Cobbler Mon Feb 09, 2009 9:24 pm

You can always use sio2ObjectDuplicate, or you can link the iname dynamically and then link the instance...
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?

Cobbler

Posts : 15
Join date : 2009-02-01

Back to top Go down

Resources - Assets and Instances Empty Scene with just assets, no instances

Post  Cobbler Wed Feb 11, 2009 5:26 pm

I have to bump this... Smile

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

Back to top Go down

Resources - Assets and Instances Empty Re: Resources - Assets and Instances

Post  sio2interactive Wed Feb 11, 2009 5:29 pm

Heuuuu just don't call sio2ResourceRender?
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Resources - Assets and Instances Empty Re: Resources - Assets and Instances

Post  sio2interactive Wed Feb 11, 2009 5:30 pm

Sorry I think I read your question a bit too fast.... can you give me more info. about exactly what you want to do...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Resources - Assets and Instances Empty Re: Resources - Assets and Instances

Post  Cobbler Wed Feb 11, 2009 5:34 pm

OK... let's see if I can explain this Smile


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

Back to top Go down

Resources - Assets and Instances Empty Re: Resources - Assets and Instances

Post  sio2interactive Wed Feb 11, 2009 7:13 pm

dude I still don't get it... that pickup thing... just give a concrete scenario used in a game...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Resources - Assets and Instances Empty Re: Resources - Assets and Instances

Post  Cobbler Wed Feb 11, 2009 7:50 pm

That is a concrete example. Pickups, you know, stuff the player picks up Smile

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

What a Face

Cobbler

Posts : 15
Join date : 2009-02-01

Back to top Go down

Resources - Assets and Instances Empty Re: Resources - Assets and Instances

Post  sio2interactive Wed Feb 11, 2009 8:01 pm

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...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

Resources - Assets and Instances Empty Re: Resources - Assets and Instances

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum