PDA

View Full Version : Unknown property: "pos" in undefined


Dogzer
10-30-2009, 02:26 PM
I have in my scene two spheres.. Sphere01 and Sphere02

I run this code in maxscript listener:


$Sphere01.pos = $Sphere02.pos
$Sphere02.pos.x += 10


And it works. But when I run this code as new maxscript:


unregisterRedrawViewsCallback jose
fn jose =
(
$Sphere01.pos = Sphere02.pos
$Sphere02.pos.x += 10
)
registerRedrawViewsCallback jose


When the function is called i get this error message: Unknown property: "pos" in undefined

I reckon the reason sphere01 doesnt have the pos property is becasue it's somehow not defined, but it is in maxscript listener. But why is $Sphere01 undefined in a new maxscript code?

Bobo
10-30-2009, 02:44 PM
I have in my scene two spheres.. Sphere01 and Sphere02

I run this code in maxscript listener:


$Sphere01.pos = $Sphere02.pos
$Sphere02.pos.x += 10


And it works. But when I run this code as new maxscript:


unregisterRedrawViewsCallback jose
fn jose =
(
$Sphere01.pos = Sphere02.pos
$Sphere02.pos.x += 10
)
registerRedrawViewsCallback jose


When the function is called i get this error message: Unknown property: "pos" in undefined

I reckon the reason sphere01 doesnt have the pos property is becasue it's somehow not defined, but it is in maxscript listener. But why is $Sphere01 undefined in a new maxscript code?

It is Sphere02 that is undefined, because you forgot the $ prefix :)

Dogzer
10-30-2009, 02:55 PM
thank you! (fast reply)

I missed that real bad :0
im just starting at maxscript!

CGTalk Moderation
10-30-2009, 02:55 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.