Home Technical Talk

Maxscript callback question...

NZA
NZA
polycounter lvl 9
Offline / Send Message
NZA polycounter lvl 9
Does anyone know If I can listen out for a certain event and fire off a method/function if triggered?

Specifically I want to be notified if a material's 'ShowInViewport' property is changed.

Is this possible?

Replies

  • Nysuatro
    (
    		unregisterRedrawViewsCallBack fn_ModUICallBack
    		function fn_ModUICallBack =
    		(
    			print "[Func]:ModUICallback"
    		)
    		registerRedrawViewsCallBack fn_ModUICallBack
    	)
    

    Always first unregister the function. Don't forget that. You will find more info about this system in the maxscripthelpfile when searching on callback viewport.
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi, unfortunately there is not a general event callback for "Show Standard Map in Viewport" assumed you're talking about that.

    You can anyhow catch it using "Node Event System" available in 3ds Max 2009+ and register the "materialOtherEvent". It is fired on every show map switch. Keep in mind it could be fired for other material editor events too.

    "registerRedrawViewsCallback" is used coupled with graphic window drawing functions, and is not meant to be an event detection system. See "Viewport Redraw Callback Mechanism" in the MaxScript reference.
  • NZA
    Offline / Send Message
    NZA polycounter lvl 9
    Thanks for the replies guys. I will try both methods see if I can get it working.

    Thanks
Sign In or Register to comment.