Skip to content

Max: Detecting illegal/cyclic references?

May 25, 2012


I’m working with weak references in a script controller and trying to get around an issue. If the reference is validated incorrectly from keyframe changes (moving, deleting etc) I get a hard script controller error – “illegal cyclic reference”.

It appears nothing can catch the error before the script controller does – callbacks, node events, all happen after the controller is evaluated.

I’d love a way to essentially ping the controller – but im not sure its possible as cyclic-error have to be caught early.

I may have to resort to creating a rollout to move edit keys etc, but that affects usability.


Post a comment
  1. JHN #
    May 25, 2012

    Can you not store the weak ref in a CA on top of the controller? Then add some logic for error handling? I have heard CA’s can eventually slow down rigs, though..

    • May 25, 2012

      Possibly, the controller is in fact dependent on a custom attribute which store the references in a maxObjectTab. I get around two issues 1) referential errors by using the weak references called by an ‘index’ attribute that does a look up into the tab. And 2) Making sure the reference is passed to the controller ‘live’ by having a pointer in the controller to each node in the tab.

      The problem is catching the error – from testing the controller, it fires signals way before anything else. It had printed 30 or so test strings even before a callback or node event fired once.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: