Duplicate / clone SIO2Object with new material
3 posters
Duplicate / clone SIO2Object with new material
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
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
Re: Duplicate / clone SIO2Object with new material
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.
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
Re: Duplicate / clone SIO2Object with new material
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...
>> In this case multi material won't work...
Re: Duplicate / clone SIO2Object with new material
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.
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
Similar topics
» What is SIO2v1.4 to duplicate it?
» Duplicate an object programmatically
» Deep copies of SIO2object
» SIO2object::col
» SIO2object->_SIO2objectphysic initialization
» Duplicate an object programmatically
» Deep copies of SIO2object
» SIO2object::col
» SIO2object->_SIO2objectphysic initialization
Permissions in this forum:
You cannot reply to topics in this forum