View Full Version : Scripted modifier with callbacks problem

12 December 2010, 12:08 PM
Why is this throwing an error?

-- Error occurred in anonymous codeblock; filename: C:\Program Files\Autodesk\3ds Max Design 2011\plugins\; position: 142; line: 8
-- Syntax error: at name, expected Plugin clause:
-- In line: callbacks.

plugin modifier proxySwitcher
name:"Proxy Switcher"
classID:#(609124, 085099)
callbacks.removeScripts id:#proxySwitcher

local switch = true
local cull = false

parameters main rollout:params
switchOnRender type:#boolean animatable:false
ui:switchOnRender default:true

rollout params "Proxy Switcher"
checkbox switchOnRender "Switch On Render"

fn onPreRender =


callbacks.addScript #preRenderFrame "onPreRender()" id:#proxySwitcher

I intend to slap this on a Container to switch out proxies, which Autodesk apparently thought we wouldnt want to do!

12 December 2010, 01:51 PM
You cannot define the callbacks just in the plugin body, you need to have it assigned in a handler for example on create for example. The callbacks are not in the right place.


12 December 2010, 12:08 AM
Ah ok. Thanks for the response :)

CGTalk Moderation
12 December 2010, 12:08 AM
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.