View Full Version : help:Script Controller Evaluation Error


slooper
11 November 2003, 03:18 AM
I have a script controller that works fine except when I first open up the max file it tells me this:

-- Unknown property: "multiplier" in $Free_Camera:DummyCam @ [0.000,0.000,0.000]

and it pops up my script window. All I have to do is click "Evaluate" and it gives me a number and works fine. No big deal except this message pops up on every renderfarm machine when we try to render the file. :(

Here is the script, any help would be greatly appreciated.


---start script
($DummyCam.Target_Distance*pi*atan($DummyCam.multiplier/$DummyCam.Convergence)*renderWidth)/($TargetPlane.width*180)
---end script




Sean Looper

LFShade
11 November 2003, 07:25 PM
I'm trying to reproduce this, so I can troubleshoot it for you, but It's not working. Or should I say, it's not not working:p I've assumed that multiplier and convergence are custom attributes on the camera, but I need to know how the rest of the scene is set up - like what channel(s) the script controller is on. Better yet, could you post a stripped-down scene that demonstrates the problem?

RH

magicm
11 November 2003, 09:57 PM
If .multiplier and Convergence are custom attributes, it might be that these attributes haven't been applied to the scene yet when the script-controller is called on scene-load.. A simple check might do the trick here:

---start script
if (hasProperty $DummyCam "multiplier") and (hasProperty $DummyCam "Convergence") then
(
($DummyCam.Target_Distance*pi*atan($DummyCam.multiplier/$DummyCam.Convergence)*renderWidth)/($TargetPlane.width*180)
)
---end script

Martijn

LFShade
11 November 2003, 10:46 PM
Yeah, that's what I assumed as well, but I couldn't reproduce the problem no matter what I assigned the script controller to (reproducing a problem is how I troubleshoot around it!). What magicm suggests might be a good general technique to avoid this kind of situation.

magicm, you da man!


RH

slooper
11 November 2003, 06:32 PM
that doesn't seem to be working. I added an 'else 0' to the end so it wouldn't error out until I fix this. I ran getPropNames on the DummyCam and all I got is this:

#(#type, #fov, #targetDistance, #nearrange, #farrange, #nearclip, #near_clip, #farclip, #far_clip, #mpassEnabled, #mpassRenderPerPass, #orthoProjection, #showCone, #showHorizon, #showRanges, #clipManually, #mpassEffect, #MultiPass_Effect)

So it seems that maxscript doesn't recognize Custom Attributes as properties. Is there another way to test Attribute names similar to how you did with the hasProperty command?

Sean

slooper
11 November 2003, 06:35 PM
I GOT IT!

While researching the hasProperty command, I found the isProperty command. For some reason, this happens with both commands:

isProperty $DummyCam "Convergence"
true
hasProperty $DummyCam "Convergence"
false

So I don't know why these commands would be different, but whatever the case, when I swapped in the isProperty command, the script works.

Thanks you guys!

Sean

CGTalk Moderation
01 January 2006, 03:00 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.


1