#
# Demonstrates how to access a Schematic node from a Softimage object.
#
# import some Softimage python shortcuts
from sipyutils import *
si = si()
# Get the 'MySchematic' schematic view object in the current layout
viewname = 'MySchematic'
activelayout = si.DeskTop.ActiveLayout
v = activelayout.Views( viewname )
# 'MySchematic' view is not created yet
if v == None:
log('Creating new schematic...: %s' % (viewname))
v = activelayout.CreateView2( "Schematic", viewname )
# Python needs to convert from View to Schematic object
sv = disp(v)
# Grab the camera root and look for the node
Application.SelectObj("Camera_Root", "", "")
node = sv.FindNode( si.Selection(0) )
(x,y,w,h) = node.UIInfo
log( 'name=%s x=%d y=%d w=%d h=%d parent=%s object=%s selected=%d expanded=%d' % (node.Name,x,y,w,h,node.Parent,node.Object,node.Selected,node.Expanded) ) |