def inspect(prop, width=None, height=None, posx=None, posy=None): # If no size define we just do a simple inspect obj if width is None or height is None: xsi.InspectObj(prop) return # Get the screen resolution to position the window screen_width, screen_height = scr.getResolution() if posx is None: posx = int((screen_width / 2.0) - (width / 2.0)) elif posx < 0: posx = int(screen_width + posx) if posy is None: posy = int((screen_height / 2.0) - (height / 2.0)) elif posy < 0: posy = int(screen_height + posy) view = xsi.Desktop.ActiveLayout.CreateView("Property Panel", "MyProperty") view.BeginEdit() view.Move(posx, posy) view.Resize(width, height) view.SetAttributeValue("targetcontent", prop.FullName) view.EndEdit()
def popWindow(prop, width=100, height=100, posX=None, posY=None): if not prop: xsi.LogMessage("Can't find property", c.siError) return False resolution = scr.getResolution() if not posX: posX = int((resolution[0] / 2.0) - (width / 2.0)) elif posX < 0: posX = int(resolution[0] + posX) if not posY: posY = int((resolution[1] / 2.0) - (height / 2.0)) elif posY < 0: posX = int(resolution[1] + posY) view = xsi.Desktop.ActiveLayout.CreateView("Property Panel", "MyProperty") view.BeginEdit() view.Move(posX, posY) view.Resize(width, height) view.SetAttributeValue("targetcontent", prop.FullName) view.EndEdit()
def inspect(prop, width=None, height=None, posx=None, posy=None): # If no size define we just do a simple inspect obj if width is None or height is None: xsi.InspectObj(prop) return # Get the screen resolution to position the window screen_width, screen_height = scr.getResolution() if posx is None: posx = int((screen_width / 2.0) - (width / 2.0)) elif posx < 0: posx = int(screen_width + posx) if posy is None: posy = int((screen_height / 2.0) - (height / 2.0)) elif posy < 0: posy = int(screen_height + posy) view = xsi.Desktop.ActiveLayout.CreateView("Property Panel", prop.Name) view.BeginEdit() view.Move(posx, posy) view.Resize(width, height) view.SetAttributeValue("targetcontent", prop.FullName) view.EndEdit()