www.quadsoftware.com
FAQ  FAQ   Search  Search   Memberlist  Memberlist   Usergroups  Usergroups
Register  ::  Log in Log in to check your private messages


Post new topic  Reply to topic
 Duplicate Object « View previous topic :: View next topic » 
Author Message
cmusch
PostPosted: Sat Dec 15, 2007 1:34 pm    Post subject: Duplicate Object Reply with quote



Joined: 02 Aug 2007
Posts: 33

Hello!

Is there an easy way to duplicate an object (properties, transform and all)?

regards
cm
Back to top
View user's profile Send private message
ALicu
PostPosted: Mon Dec 17, 2007 7:36 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Are you referring to instances? Or both instances and templates?

There is no Clone function (yet) in the SDK. For now you can manually replicate any instance or template using a code similar with that used by the storage plugins (create the instance, set its transform, etc).

For property tables there is iPropertyTable::Clone function which can replicate a table with all its structure and values. Then you need to assign it to the newly created instance.

The manually replication is pretty straightforward. If you need I can post a code snippet for it.

Regards,
Adrian L.
Back to top
View user's profile Send private message
cmusch
PostPosted: Mon Dec 17, 2007 8:44 am    Post subject: Reply with quote



Joined: 02 Aug 2007
Posts: 33

Hi!

I was looking for a way for our artist to duplicate instances which have a property table set. We need several instances of similar objects, and it is somewhat cumbersome to create them all by hand.
I think I'll do what you suggested and write a "clone" plugin, but you can also consider this a feature suggestion (perhaps ship the "clone" plugin as an example?) Wink

regards
cm
Back to top
View user's profile Send private message
ALicu
PostPosted: Mon Dec 17, 2007 9:49 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

You can clone instances by using shift and drag while in translation tool (same at it is for example in 3DS Max). Just select the instance you want to clone, open the translate tool (Control + T by default), hold shift key down and drag with the mouse using one of the gizmo axes. Instead moving the instance, a new one is cloned and moved.

Now, the only problem is that the property tables are not duplicated (this was an omission i think). I will have it fixed and added in the next patch.

Regards,
Adrian L.
Back to top
View user's profile Send private message
cmusch
PostPosted: Mon Dec 17, 2007 9:58 am    Post subject: Reply with quote



Joined: 02 Aug 2007
Posts: 33

Thanks a lot!!
Back to top
View user's profile Send private message
ALicu
PostPosted: Tue Dec 18, 2007 5:44 pm    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Hi,

You can access the latest patch (01.10.19) which adds this feature (copying property tables while cloning objects). Let me know if you have any problems.

Regards,
Adrian L.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Based on a template by Dustin Baccetti
Powered by phpBB © 2001, 2005 phpBB Group