  | | | Scripted operators with N input connections | Scripted operators with N input connections 2005-04-24 - By Guy Rabiller
Back MessaggioHi Michele,
there are two ways for doing it.
Either by creating a scripted operator from script, in wich case you'll use the "AddPortGroup" method wich recieve as arguments "Min" and "Max". Those arguments indicate the minimum/maximum items that can be connected for a valid connection. If you use 0 for min and a big number for max, you will create an optional port group meaning that at operator creation time there is no need for something to be connected, but you can add as many items ( up to the max limit ) as you want , and remove items from the group down to none, without deleting the operator.
Either by editing an operator SPDL, and add in a group description: Min = 0; Max = Infinite; for instance.
Once you've done this, the way you organize your 'group' of connected items is up to you, and has nothing to do with the way the portgroup is defined. If you use a Group in your scene, you will have to synchornize manualy the members of the group and the connected item in the operator portgroup.
May be add an 'Update' button in your Operator PPG wich would call a Command, updating the portgroup connections regarding to some predifined Group or even a connected Group so you can query both the Group content and the PortGroup content directly and synchronize them.
Hope this helps. -- guy rabiller | 3d technical director @ LaMaison
-- -- Original Message -- -- From: Michele To: xsi@(protected) Sent: Thursday, April 21, 2005 11:57 AM Subject: Scripted operators with N input connections
Hi, I need to plug a number of input objects into a scripted operator; the number of these objects can be increased of decreased.
I've tried doing this with a group, but I cannot access its members via the .members property via scops.
Maybe someone already did something like this before and could help me.
Thanks
Michele motionblur@(protected)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Messaggio</TITLE> <META http-equiv=Content-Type content="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1"> <META content="MSHTML 6.00.2800.1491" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#e9ede3> <DIV><FONT face=Arial size=2>Hi Michele,</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>there are two ways for doing it.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Either by creating a scripted operator from script , in wich case you'll use the "AddPortGroup" method wich recieve as arguments "Min" and "Max".</FONT></DIV> <DIV><FONT face=Arial size=2>Those arguments indicate the minimum/maximum items that can be connected for a valid connection.</FONT></DIV> <DIV><FONT face=Arial size=2>If you use 0 for min and a big number for max, you will create an optional port group meaning that at operator creation time there is no need for something to be connected, but you can add as many items ( up to the max limit ) as you want, and remove items from the group down to none, without deleting the operator.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Either by editing an operator SPDL, and add in a group description: </FONT></DIV> <DIV><FONT face=Arial size=2>Min = 0;</FONT></DIV> <DIV><FONT face=Arial size=2>Max = Infinite;</FONT></DIV> <DIV><FONT face=Arial size=2>for instance.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Once you've done this, the way you organize your 'group' of connected items is up to you, and has nothing to do with the way the portgroup is defined.</FONT></DIV> <DIV><FONT face=Arial size=2>If you use a Group in your scene, you will have to synchornize manualy the members of the group and the connected item in the operator portgroup.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>May be add an 'Update' button in your Operator PPG wich would call a Command, updating the portgroup connections regarding to some predifined Group or even a connected Group so you can query both the Group content and the PortGroup content directly and synchronize them.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Hope this helps.</FONT></DIV> <DIV>--<BR>guy rabiller | 3d technical director @ LaMaison</DIV> <DIV><BR> </DIV> <BLOCKQUOTE dir=ltr style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV style="FONT: 10pt arial">-- -- Original Message -- -- </DIV> <DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> <A title=motionblur@(protected) href="mailto:motionblur@(protected)">Michele</A> </DIV> <DIV style="FONT: 10pt arial"><B>To:</B> <A title=xsi@(protected) href="mailto:xsi@(protected)">xsi@(protected)</A> </DIV> <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, April 21, 2005 11:57 AM</DIV> <DIV style="FONT: 10pt arial"><B>Subject:</B> Scripted operators with N input connections</DIV> <DIV><BR></DIV> <DIV><SPAN class=646074509-21042005><FONT face=Arial size=2>Hi, I need to plug a number of input objects<FONT face=Arial size=2></FONT> into a scripted operator; the number of these objects can be increased of decreased.</FONT></SPAN></DIV> <DIV><SPAN class=646074509-21042005><FONT face=Arial size=2></FONT></SPAN> </DIV> <DIV><SPAN class=646074509-21042005><FONT face=Arial size=2>I've tried doing this with a group, but I cannot access its members via the .members property via scops.</FONT></SPAN></DIV> <DIV><SPAN class=646074509-21042005><FONT face=Arial size=2></FONT></SPAN> </DIV> <DIV><SPAN class=646074509-21042005><FONT face=Arial size=2>Maybe someone already did something like this before and could help me.</FONT></SPAN></DIV> <DIV><SPAN class=646074509-21042005><FONT face=Arial size=2></FONT></SPAN> </DIV> <DIV><SPAN class=646074509-21042005><FONT face=Arial size=2>Thanks</FONT></SPAN></DIV> <DIV><SPAN class=646074509-21042005><FONT face=Arial size=2></FONT></SPAN> </DIV> <DIV><SPAN class=646074509-21042005><FONT face=Arial size=2>Michele</FONT></SPAN></DIV> <DIV><SPAN class=646074509-21042005><FONT face=Arial size=2><A href="mailto:motionblur@(protected)">motionblur@(protected)</A></FONT>< /SPAN></DIV> <DIV><SPAN class=646074509-21042005><FONT face=Arial size=2></FONT></SPAN> </DIV></BLOCKQUOTE></BODY></HTML>
|
|
 |