Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / SDK / Retrieve the CallParam from a NOTIFY_POST_NODES_CLONED callback
  RSS 2.0 ATOM  

Retrieve the CallParam from a NOTIFY_POST_NODES_CLONED callback
Rate this thread
 
63804
 
Permlink of this thread  
avatar
  • Jason:.
  • Posted: 23 January 2012 05:17 PM
  • Total Posts: 17
  • Joined: 06 September 2011 07:41 PM

Hi folks, I’m trying to implement setting some user properties on an object after it is cloned but I need some help accessing the callParams, and then the node.

The documentation says that the CallParam for NOTIFY_POST_NODES_CLONED is a pointer to this struct:

struct{ INodeTaborigNodesINodeTabclonedNodesCloneType cloneType;}

But I don’t know how to deal with this in my C#.Net plugin.

I have found some code to marshal the infoPtr but I am stuck regarding the ObjPtr

private void ObjectCloned(IntPtr ObjPtrIntPtr infoPtr)
   
{
      IGlobal 
global = Autodesk.Max.GlobalInterface.Instance;
      
INotifyInfo info = global.NotifyInfo.Marshal(infoPtr);

[edit*]
I have done some more investigations and perhaps what I’m after is not to interpret the ObjPtr but to interpret the info.CallParams. Either way I need some advice on how to marshal the ptr to a struct as defined above.
[/edit*]

I’m using Windows7, Max 2012, + subscription advantage pack.

Any help greatly appreciated.
Cheers



3DSMax 2012 with subscription advantage pack / Windows 7 Enterprise

Replies: 0
avatar
  • Jason:.
  • Posted: 24 January 2012 04:07 PM

I am adding some developments that I have managed to work out and I believe are accurate.

I have implemented a struct in c# as follows

[StructLayout(LayoutKind.Sequential), Serializable]
        
public struct CloneInfo
        {
            
public IntPtr OrigNodes;
            public 
IntPtr ClonedNodes;
            public 
Int32 CloneType;
        
}

I have then been able to populate an instance of the struct with the data contained in notifyInfo.CallParams. See here ->

CloneInfo ci = (CloneInfo)Marshal.PtrToStructure((IntPtr)info.CallParamtypeof(CloneInfo));

I have verified that the CloneType is being set correctly however now I could use some help accessing the OrigNodes INodeTab.

Cheers.



3DSMax 2012 with subscription advantage pack / Windows 7 Enterprise

Replies: 0