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 / Selecting a node
  RSS 2.0 ATOM  

Selecting a node
Rate this thread
 
62680
 
Permlink of this thread  
avatar
  • Seggaeman
  • Posted: 08 December 2011 08:39 PM
  • Total Posts: 16
  • Joined: 01 December 2011 01:20 AM

I have an importer plugin that creates nodes and wish to select one of them. (It is not a node which exists in the scene prior to import that is).

A simple task at first glance; but the following code doesn’t work (or is not sufficient).

theHold.Begin();
interfacePtr->SelectNode(theNode0);
theHold.Accept("Selection");

Neither does this

ExecuteMAXScriptScript("select $<node name>");

How to do it?



Replies: 1
/img/forum/dark/default_avatar.png

Are you sure theNode is valid?
If interfacePtr and theNode are valid it should work just fine.

Author: Jake Jeziorski

Replied: 08 December 2011 08:46 PM  
avatar
  • Seggaeman
  • Posted: 08 December 2011 08:56 PM

Yes I’m sure they are. This is not the only code in the plugin; I’m referencing the same interface and node pointer in several other places.

For example

InterfacePtr->CreateInstance(...);
theNode->SetName("someName");

are working fine.



Replies: 0
avatar
  • Seggaeman
  • Posted: 08 December 2011 09:05 PM

This will look odd. I tested this code in a utility plugin:

::theHold.Begin();
InterfacePtr->SelectNode(theNode);
theHold.Accept("Select");

And it’s working.

Should I conclude that SceneImport plugins automatically deselect everything in the scene? I tested InterfacePtr->GetSelNodeCount in the import plugin using a message box hook and it returns 1. But subsequently after the scene is created everything is deselected.



Replies: 0