PDA

View Full Version : Using getProperty function for Matrix values?


Malkalypse
02-07-2008, 04:49 AM
I am working on a script that shows the results of using getProperty on various object properties
(i.e. getProperty $ "pos.x", or getProperty $ "wireColor" etc.)

There are some oddities with the way some of these things have to be structured. For example, (getProperty $ "rotation.x_rotation") works and (getProperty $.rotation "x_rotation") does not, while conversely (getProperty $ "rotation.x") does NOT work while conversely $.rotation "x") DOES.

I need to know if there is any direct way to use getProperty to get Matrix values. I know I can use the format of (getProperty $.transform.row1 "x"), but due to the way my code is structured for other properties, it would be immensely helpful if there were some way I could use getProperties on the base object (in this case $) to get the Matrix values.

In other words, the way (getProperty $ "rotation.x_rotation") works, I would like to be able to do something along the lines of (getProperty $ "transform.row1.x").

I feel like I am making this sound much more complicated than it needs to be, because it's a really simple problem. I just want to make sure that I am explaining it clearly...

Bobo
02-07-2008, 05:28 AM
I am not sure I understand the problem.

getProperty $ "transform"

returns the matrix3 value. What exactly do you want to get?

You can stack these as

a = (getProperty $ "transform")
-->(matrix3 [1,0,0] [0,1,0] [0,0,1] [0.1,0.1,0])
b = getProperty a "row1"
-->[1,0,0]
c = getProperty b "x"
-->1.0

but if your code does not work for what you are doing, change the code ;)

Malkalypse
02-07-2008, 04:48 PM
Thanks Bobo, I think that changing the code is what I will end up doing. I figured I would probably have to anyway, I was just being a lazy Malk. :D

CGTalk Moderation
02-07-2008, 04:48 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.