New view attributes in 2012


For the Scene Layer Manager, there is a selectedlayer attribute.

For the Schematic view, there are two view attributes: AnchorPointID and Target.
Target is available for the node context menu only.

Here’s some code from the new Schematic example in the XSI SDK workgroup:

def XSILoadPlugin( in_reg ):
	#...
	in_reg.RegisterMenu(C.siMenuSchematicNodeContextID,"LogNodeInfo_Menu",False,False)	
	#...

def LogNodeInfo_Menu_Init( in_ctxt ):
	oMenu = in_ctxt.Source
	oMenu.AddCallbackItem("Log Node Info","log_info_cb")	
	return True

def log_info_cb( ctxt ):

	Application.LogMessage("log_info_cb called")

	# Returns the view object or a list with the view object and the target node (siMenuSchematicNodeContextID only)		
	target = ctxt.GetAttribute('Target')
	anchorPtID = ctxt.GetAttribute('AnchorPointID')
	# ...

Leave a Reply

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

WordPress.com Logo

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

Google photo

You are commenting using your Google 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