Duplicate / clone SIO2Object with new material

View previous topic View next topic Go down

Duplicate / clone SIO2Object with new material

Post  konstruktor on Sat Mar 28, 2009 9:06 am

Hi guys,

SIO2ObjectDuplicate doesn't duplicate the object completly.

[code]
_SIO2object= sio2ObjectDuplicate( old, old->_SIO2transform,name, false);

//problem: _SIO2vertexgroup doesn't exists becauce it is just shared, but I just want to change the material
SIO2material *_SIO2material = SIO2object->_SIO2vertexgroup[0]->_SIO2material; //or sio2MaterialInit

_SIO2material->_SIO2image[0] = _SIO2image;

sio2ImageGenId(_SIO2material->_SIO2image[0], _SIO2material->tflags[0], _SIO2material->tfilter[0]);
[/code|

Perhaps somebody knows a workaround.

Thank you,
konstruktor


edit:
Made my own dirty way:

I added an SIO2material to SIO2Object and modfied the object->render function and also the vertexgroup->render one to take the material from SIO2object.

My advice: Apply the SIO2material not to the vertexgroup but to the SIO2Object in the next version of the engine


Last edited by konstruktor on Sat Mar 28, 2009 10:04 am; edited 1 time in total (Reason for editing : dirty solution)

konstruktor

Posts : 6
Join date : 2009-03-13

View user profile

Back to top Go down

Re: Duplicate / clone SIO2Object with new material

Post  billykater on Tue May 19, 2009 4:45 am

Has there been any progress on this topic.
I have exactly the same problem where I would like to change the material of only one object.
If there isn't an builtin solution I will go the same route as the topic creator.

billykater

Posts : 4
Join date : 2009-02-18

View user profile

Back to top Go down

Re: Duplicate / clone SIO2Object with new material

Post  sio2interactive on Tue May 19, 2009 2:04 pm

My advice: Apply the SIO2material not to the vertexgroup but to the SIO2Object in the next version of the engine

>> In this case multi material won't work...

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

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

View user profile http://sio2interactive.com

Back to top Go down

Re: Duplicate / clone SIO2Object with new material

Post  billykater on Wed May 20, 2009 4:36 pm

The sentence you quoted was from the original post from about Mar 28. Anyway good advice for any other going over this post.
Tomorrow I will attempt to do some changes to the engine to support these kind of material changes.
I thought about duplicating the vertexgroup structure but keep all data from the original vertexgroup so the only overhead would be an additional vertexgroup structure in memory.
For my application this should work and I will try to do a patch that you can review afterwards.


Last edited by billykater on Wed May 20, 2009 4:41 pm; edited 1 time in total (Reason for editing : Removed typos)

billykater

Posts : 4
Join date : 2009-02-18

View user profile

Back to top Go down

Re: Duplicate / clone SIO2Object with new material

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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