Callback comaptibility issues

Callback comaptibility issues

elpie89
Advocate Advocate
621 Views
1 Reply
Message 1 of 2

Callback comaptibility issues

elpie89
Advocate
Advocate

I need to add retro-compatibility for  this function

 

 public void RegisterNodeAddedCallback()
        {
            if (!nodeAddedCallback)
            {
                m_NodeAddedDelegate = new GlobalDelegates.Delegate5(this.OnNodeAdded);
                GlobalInterface.Instance.RegisterNotification(this.m_NodeAddedDelegate, null, SystemNotificationCode.SceneAddedNode );

                nodeAddedCallback = true;
            }
        }

In max 2019 the signature for OnNodeAdded is:

private void OnNodeAdded(IntPtr objPtr, INotifyInfo infoPtr)
{
        IINode n = (IINode)infoPtr.CallParam;
}

In max 2016 I the signature is this:

 

private void OnNodeAdded(IntPtr param0, IntPtr param1)

How can I get the node or his handle from this signature?

0 Likes
622 Views
1 Reply
Reply (1)
Message 2 of 2

elpie89
Advocate
Advocate

Actually I have an update

I'm using this to handle the 2016 version

 private void OnNodeAdded(IntPtr param0, IntPtr param1)
{            
                INotifyInfo obj = Loader.Global.NotifyInfo.Marshal(param1);
                IINode n = (IINode) obj.CallParam;
}

The problem now is that this work with 

SystemNotificationCode.NodeCreated and not with SystemNotificationCode.SceneAddedNode

is this a bug?

0 Likes