Page 1 of 1

Accessing cloned non-avatar objects

PostPosted: Wed Mar 13, 2013 1:47 pm
by Zatiria
Hi. I have a simple question: How can I access cloned objects that aren't avatars (eg. "ArchOfKerath")?

I am using the Funhouse's Clone function for cloning such objects, the code of which is as follows:

Code: Select all
# World.Clone(string obj, string count, string age)
# Clones an object a specified number of times.
def Clone(obj="Beachball", count=5, age=None):

    if not age:
        age = PtGetAgeName()
    so = PtFindSceneobject(obj, age).getKey()
    me = PtGetLocalAvatar().getKey()
    for i in range(count):
        PtTransferParticlesToObject(so, me, 1)


This function does what's it's supposed to do but it has one problem: Once the object has been cloned I have no way of accessing the clone because I can't get its ptSceneobject or ptKey instance.

The default way of getting the ptSceneobject instance of an object by searching for it using it's name does not work here because both the original and the clone have the same name so I just end up getting the ptSceneobject of the original.

This problem would be solved very easily if the PtTransferParticlesToObject function actually returned the ptSceneobject or ptKey instance for the clone but unfortunately I don't that is the case.

Any input including a better way of cloning objects, if such exists, is welcome

Re: Accessing cloned non-avatar objects

PostPosted: Wed Mar 13, 2013 1:56 pm
by Christopher
Well PtTransferParticlesToObject(...) is not really intended to clone objects I think... But AFAIK there is no other way of cloning Sceneobjects.

Christopher

Re: Accessing cloned non-avatar objects

PostPosted: Wed Mar 13, 2013 10:45 pm
by Mystler
I think transfering particles only works with particle systems.