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