Notifications
Clear all

[Closed] Scipt Controller Error, Please help

Hi All …
While rigging a character, I am using script controllers (position) for 9 Helper Objects.
These scripts are almost the same on all the helpers. All these scripts have this line :

Rigd = (20 – $Teapot01.rigidity)

Now, the parameter ‘rigidity’ that you see above is a simple custom attribute of type integer that I added to this teapot.

Trouble is that the script controllers on all objects works without any problems as long as I dont close Max, or reset my scene. But when I load my scene again, I have these 10 thousand windows opening up and telling me :
>> MAXScript Script Controller Exception: – Unknown property: “Rigidity” in $Teapot:Teapot01 @ [56.894974,-28.709782,0.000000] <<

When I okay these windows and when I ‘evaluate and close’ the script windows that had popped up, everythings fine…
This script is really giving me good results but with these errors, I wont be able to network render …

Has anyone faced a similar error … any solutions? … please help
Another question :
Does Max remember which object was created first, which last? When loading a file, does it respect this order?

I hope I made my problem clear … if it didn’t make any sense, please say so, I’ll try to rephrase it…

Thanks, guys

7 Replies

have you tried to access your CA directly like $Teapot01.modifiers[#Attribute_Holder].rigidity… ?

actually, my CA is at the base level, and I am able to access it simply with $Teapot01.rigidity
-shibu

1 Reply
(@magicm)
Joined: 11 months ago

Posts: 0

I think what happens is that the CA definition hasn’t been loaded yet when the script controller is being evaluated for the first time. This check should prevent the error from popping up:

Rigd = if isproperty $Teapot01 #rigidity then (20 - $Teapot01.rigidity) else 0

So in this case if the CA hasn’t been initialized yet, Rigd is set to 0.

  • Martijn

I forgot to mention …
I tried a similar script in a simple scene which had nothing but a couple of helpers and a teapot…
I saved the scene and opened it … NO Errors

You could try attaching the max file so others can take a look?

hi, what martin says is correct – it is becasue the CA definition is no loaded before the value is accessed
i usually use this code to correct this kind of thing
if $Teapot01.rigidity != undefined then
(
code for script here!!
)
else 0

mark

Thanks everyone …
I haven’t tried any of the suggestions yet … got really involved in something else …
will post a feedback soon.

  • shibu