Obejct has no attributes!

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Obejct has no attributes! // New Users

1  |  

Post by buffolli // Jan 31, 2007, 10:30am

buffolli
Total Posts: 9
Please take a look at this script, it copies the animation of an object which is glued to a bone structure to a cloneobject. Afterwards this clone could be exported with animation.


Unfortunately not every object has got attributes so I cannot copy animation to its clone!


tklFrameFrom = 0

tklFrameTo = 230

tklObjektNameOriginal = "held\M\SR\A\U\UA\HG\H\axt,1"

tklObjektNameClone = "axtclone,1"


def ontimestarted():


global tklTime

global tklObjectOriginal

global tklObjectClone


tklTime = tklFrameFrom


tklObjectOriginal = doc.Object(tklObjektNameOriginal)

tklObjectClone = doc.Object(tklObjektNameClone)



def ontimechanged():


global tklTime

global tklObjectOriginal

global tklObjectClone


if (tklTime <= tklFrameTo):


doc.ActiveTime = tklTime


tklObjectClone.Rotation = (tklObjectOriginal.Rotation[0], tklObjectOriginal.Rotation[1], tklObjectOriginal.Rotation[2])

tklObjectClone.Position = (tklObjectOriginal.Position[0], tklObjectOriginal.Position[1], tklObjectOriginal.Position[2])

tklObjectClone.SetFrame()


tklTime = tklTime + 1


else:


trueSpace.Stop()



Whenever I start the script, I receive a error message:




AttributeError'None' object has no attribute 'Rotation'Traceback (innermost last):

File "C:\trueSpace66\TSP2.py", line 29, in ontimechanged

tklObjectClone.Rotation = (tklObjectOriginal.Rotation[0], tklObjectOriginal.Rotation[1], tklObjectOriginal.Rotation[2])



But with another object (a sword) everything works fine.

Only this axt,1 does not what it should!



Thank you for quick support.


Greetings


buffolli
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn