Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Object Transform changes when it shouldn't

Object Transform changes when it shouldn't

leeminardi
Mentor Mentor
398 Views
1 Reply
Message 1 of 2

Object Transform changes when it shouldn't

leeminardi
Mentor
Mentor

Here's a very basic question.  It looks like the assignment statement (e.g., m = TpotT) is not creating an independent copy of TpotT.

 

I have a scene with a box and a Teapot.  The box has the following transform script:

m = TpotT
format "\nTpotT BEFORE = %" TpotT
m.pos = [1,2,3]
format "\nTpotT AFTER = %" TpotT
m

leeminardi_0-1648833453095.png

The output from this script is as follows:

TpotT BEFORE = (matrix3 [0.606322,0.217622,0.764862] [0.296822,0.830378,-0.47156] [-0.737746,0.512946,0.438881] [500.746,703.19,0])
TpotT AFTER = (matrix3 [0.606322,0.217622,0.764862] [0.296822,0.830378,-0.47156] [-0.737746,0.512946,0.438881] [1,2,3])

I would not expect that changing a vector of m would change the same vector of TpotT.

 

How can I create a matrix from TpoT and change the position vector without changing TpotT?

lee.minardi
0 Likes
Accepted solutions (1)
399 Views
1 Reply
Reply (1)
Message 2 of 2

leeminardi
Mentor
Mentor
Accepted solution

I found the answer for an independent copy of a matrix.

m = copy TpotT

Duh!

lee.minardi
0 Likes