Re: Custom Op : Dynamic port connected to float parameters

2015-07-23 Thread Matt Lind
Make sure you're defining a self installing custom operator and not a 
runtime based scripted operator as the latter is officially deprecated.


Also, connecting directly to output parameters is only supported if your 
operator has a single output.  Since you have multiple outputs, that's 
likely the problem.  Try using port groups and ports explicitly instead.



Matt






Date: Wed, 22 Jul 2015 11:45:04 -0700
From: Jeremie Passerin gerem@gmail.com
Subject: Custom Op : Dynamic port connected to float parameters
To: softimage@listproc.autodesk.com

Hey guys !

We're having issue here creating a simple scripted operator that takes an
undefined number of float parameters as input and has an undefined number
of float outputs.
We are using PortGroups but it's not connecting to the parameter but to the
property, depsite me passing the parameter.

Here is a sample python code:


xsi = Application
from win32com.client import constants

xsi.NewScene( None, False )

prop = xsi.ActiveSceneRoot.AddProperty(CustomProperty, False, Inputs)
inParam1 = prop.AddParameter3(input1, constants.siDouble, 0 )
inParam2 = prop.AddParameter3(input2, constants.siDouble, 0 )

prop = xsi.ActiveSceneRoot.AddProperty(CustomProperty, False, Outputs)
outParam1 = prop.AddParameter3(output1, constants.siDouble, 0 )
outParam2 = prop.AddParameter3(output2, constants.siDouble, 0 )

sop = XSIFactory.CreateScriptedOp( MyOperator, , JScript )
inputGroup = sop.AddPortGroup( Inputs, 1, 99,  )
outputGroup = sop.AddPortGroup( Outputs, 1, 99,  )

sop.AddInputPortByClassID( constants.siParameterID, inputParam,
inputGroup.Index )
sop.AddOutputPortByClassID( constants.siParameterID, outputParam,
outputGroup.Index )


sop.ConnectToGroup(inputGroup.Index, inParam1)
sop.ConnectToGroup(outputGroup.Index, outParam1)
sop.ConnectToGroup(inputGroup.Index, inParam2)


What are we doing wrong ? any idea ?
Am I using the right classID ? siParameterID ?

thanks,
Jeremie 



Re: How to clear operators from an object without applying?

2015-07-23 Thread Matt Lind
/pipermail/softimage/attachments/20150723/5d1d71ae/attachment.html


--

___
Softimage mailing list
Softimage@listproc.autodesk.com
http://listproc.autodesk.com/mailman/listinfo/softimage


End of Softimage Digest, Vol 80, Issue 53
* 



Re: Simple question - Dorito setup

2015-07-23 Thread Alan Fregtman
Long ago I recorded a 20m tutorial/explanation about doritos for TDSurvival:
https://vimeo.com/68359879

I think it might help you. Let me know if anything is not clear.

On Thu, Jul 23, 2015, 2:01 AM Eric Turman i.anima...@gmail.com wrote:

 I am way too tired to make a clean scene let alone a clean script, but
 this python script builds a very simple scene that has a dorito deforming
 a cloned mesh and being influenced by the driver mesh. The move null
 functions like a COG and everything plays nice:

 Application.CreatePrim(Sphere, MeshSurface, , )
 Application.GetPrim(Null, , , )
 Application.SetValue(null.Name, bottom, )
 Application.Translate(, 0, -4, 0, siRelative, siParent, siObj,
 siXYZ, , , , , , , , , , 0, )
 Application.SetValue(bottom.null.shadow_icon, 2, )
 Application.SetValue(bottom.null.shadow_scaleY, 0, )
 Application.SetValue(bottom.null.primary_icon, 0, )
 Application.SetValue(bottom.null.size, 3, )
 Application.Duplicate(bottom, , 2, 1, 1, 0, 0, 1, 0, 1, , , ,
 , , , , , , , 0)
 Application.Translate(, 0, 8, 0, siRelative, siParent, siObj,
 siXYZ, , , , , , , , , , 0, )
 Application.SetValue(bottom1.Name, top, )
 Application.SelectObj(sphere, , True)
 Application.Clone(, , 1, 1, 0, 0, 1, 0, 1, , , , , , , ,
 , , )
 Application.SelectObj(sphere, , )
 Application.SetValue(sphere.Name, driver, )
 Application.SelectObj(sphere1, , )
 Application.SetValue(sphere1.Name, clone, )
 Application.SelectObj(driver, , )
 Application.ApplyFlexEnv(driver;bottom,top, , 2)
 Application.GetPrim(Null, , , )
 Application.SetValue(null.Name, clusterConstrainedNull, )
 Application.GetPrim(Null, , , )
 Application.SetValue(null.Name, dorito, )
 Application.SetValue(dorito.null.primary_icon, 0, )
 Application.SetValue(dorito.null.shadow_icon, 8, )
 Application.SetValue(dorito.null.shadow_scaleX, 0, )
 Application.SelectObj(clusterConstrainedNull, , )
 Application.SelectObj(clone, , )
 Application.ToggleVisibility(, , )
 Application.SelectObj(clusterConstrainedNull, , )
 Application.ApplyCns(ObjectToCluster, clusterConstrainedNull,
 driver.pnt[19], )
 Application.SetValue(clusterConstrainedNull.kine.objclscns.tangent,
 True, )
 Application.SetValue(clusterConstrainedNull.kine.objclscns.upvct_active,
 True, )
 Application.SelectObj(dorito, , )
 Application.ParentObj(B:clusterConstrainedNull, dorito)
 Application.SelectObj(B:clusterConstrainedNull, , )
 Application.SelectObj(dorito, , )
 Application.ResetTransform(, siObj, siSRT, siXYZ)
 Application.GetPrim(Null, , , )
 Application.SetValue(null.Name, move, )
 Application.SetValue(move.null.primary_icon, 0, )
 Application.SetValue(move.null.shadow_icon, 2, )
 Application.SetValue(move.null.shadow_scaleY, 0, )
 Application.SetValue(move.null.size, 5, )
 Application.SelectObj(bottom, , )
 Application.ToggleSelection(top, , )
 Application.ParentObj(B:move, bottom,top)
 Application.SelectObj(B:move, , )
 Application.DeselectAll()
 Application.SelectObj(bottom, , )
 Application.SelectObj(bottom,top, , )
 Application.SetNeutralPose(, siSRT, )
 Application.SelectObj(move, , )
 Application.AddProp(Display Property, , , , )
 Application.SetValue(move.display.wirecolorr, 0.381, )
 Application.SetValue(move.display.wirecolorg, 0.381, )
 Application.SetValue(move.display.wirecolorb, 0.381, )
 Application.SetValue(move.display.wirecolorr, 0.76, )
 Application.SetValue(move.display.wirecolorg, 0, )
 Application.SetValue(move.display.wirecolorb, 0, )
 Application.SetValue(move.display.wirecolorr, 0.110376, )
 Application.SetValue(move.display.wirecolorg, 0.756, )
 Application.SetValue(move.display.wirecolorb, 0, )
 Application.GetPrim(Null, , , )
 Application.SetValue(null.Name, noDeform, )
 Application.ApplyCns(Pose, noDeform, move, )
 Application.SelectObj(clusterConstrainedNull, , )
 Application.SelectObj(dorito, , )
 Application.SelectObj(move, , True)
 Application.SelectObj(driver, , True)
 Application.ToggleVisibility(, , )
 Application.SelectObj(clone, , )
 Application.ToggleVisibility(, , )
 Application.ApplyFlexEnv(clone;noDeform,dorito, , 2)
 Application.SetValue(clone.polymsh.cls.EnvelopWeightCls.Envelope_Weights.autoenvassign.defnbskelobj,
 1, )
 Application.SetValue(clone.polymsh.cls.EnvelopWeightCls.Envelope_Weights.autoenvassign.defnbskelobj,
 2, )
 Application.SelectObj(noDeform, , )
 Application.CopyPaste(move.kine.global.posz, ,
 noDeform.Static_KineState.posz, 1)
 Application.CopyPaste(move.kine.global.posy, ,
 noDeform.Static_KineState.posy, 1)
 Application.CopyPaste(move.kine.global.posx, ,
 noDeform.Static_KineState.posx, 1)
 Application.CopyPaste(move.kine.global.rotz, ,
 noDeform.Static_KineState.oriz, 1)
 Application.CopyPaste(move.kine.global.roty, ,
 noDeform.Static_KineState.oriy, 1)
 Application.CopyPaste(move.kine.global.rotx, ,
 noDeform.Static_KineState.orix, 1)
 Application.CopyPaste(move.kine.global.sclz, ,
 noDeform.Static_KineState.sclz, 1)
 Application.CopyPaste(move.kine.global.scly, ,
 noDeform.Static_KineState.scly, 1)
 

snow

2015-07-23 Thread Kris Rivel
I saw this and could really use it!!! I don't see this compound on any of
the usual sources. Does anyone have this? Who is the author?

https://youtu.be/wU4t145Bn_M

Kris


Re: How to clear operators from an object without applying?

2015-07-23 Thread Martin
Hi Pedro.

Selection is a collection object, not an array. Use Count instead.

Martin
Sent from my iPhone

 On 2015/07/24, at 3:35, pedro santos probi...@gmail.com wrote:
 
 Hi Martin
 Thanks again for coming up with a solution, this works great! I changed it a 
 bit to add a integer stack selection. I was actually surprised it ran the 
 function before it was defined unlike Python :) Problem is I don't know JS :P 
 So I tried to loop over selection with no avail. I noticed that if I had 
 several objects selected used selection(0) or selection(1) it did something 
 accordingly, but apparently I can not use .lenght to define a loop duration: 
 // ERROR : Object doesn't support this property or method - [line 30]
 
 I don't know how to loop it... Well, I cal set a fixed number like 999 in  
 for (var i = 0; i  selection.length; i++) { and just cope with the out of 
 range error :)
 
 Thanks
 Pedro
 
 // JScript
 
 function delOps(oObj){
   var oOpColl = new ActiveXObject( XSI.Collection );
   var oOpStack = new Enumerator( oObj.ActivePrimitive.ConstructionHistory 
 );
   
   for (;!oOpStack.atEnd();oOpStack.moveNext()){
   if (oOpStack.item().name == stack){
   var ModelingFlag =   1;
   continue;
   }
   if (ModelingFlag == 1){
   oOpColl.add (oOpStack.item());
   }
   }
   
   if (oOpColl.Count0)DeleteObj( oOpColl ) ;
 }
 
 var pickstack = 2;
 var stack = [Modeling, Shape Modeling, Animation, Secondary Shape 
 Modeling][pickstack];
 
 
 //Loop Attempt #1
 for (i in selection) {
 delOps(i);
 }
 
 //Loop Attempt #1
 for (var i = 0; i  selection.length; i++) { // Throws error that selection 
 doesn't support .length
 delOps(selection(i));  
 }
 
 On Thu, Jul 23, 2015 at 10:17 AM, Martin Yara furik...@gmail.com wrote:
 Just delete them? Or you mean by script
 
 I wrote something similar in JScript to freeze some operators under certain 
 stack. I just changed it to delete all operators below the Modeling Stack. 
 It only works with 1 object, you'll need to add a loop.
 
 // JScript
 
 delOps(selection(0))
 
 function delOps(oObj){
  var oOpColl = new ActiveXObject( XSI.Collection );
  var oOpStack = new Enumerator( oObj.ActivePrimitive.ConstructionHistory 
 );
  
  for (;!oOpStack.atEnd();oOpStack.moveNext()){
  if (oOpStack.item().name == Modeling){
  var ModelingFlag = 1;
  continue;
  }
  if (ModelingFlag == 1){
  oOpColl.add (oOpStack.item());
  }
  }
  
  if (oOpColl.Count0)DeleteObj( oOpColl ) ;
 }
 
 
 Martin
 
 
 On Thu, Jul 23, 2015 at 5:47 PM, pedro santos probi...@gmail.com wrote:
 Hi
 Quite a few times when I'm adding operators to multiple objects I would 
 also like to clear those objects of any operator. This is not Freezing, as 
 I do not want to apply those operators, but remove them. More over if the 
 above is possible, is it also possible to remove operators only from the 
 modeling stack? Alike one uses Freeze and Freeze modeling differently?
 
 Thanks
 Pedro
 
 
 
 -- 
 
 Pedro Alpiarça dos Santos 
 Animator  3DModeler  Illustrator 
   http://probiner.x10.mx/
 


Re: Custom Op : Dynamic port connected to float parameters

2015-07-23 Thread Steven Caron
I loaded your script up and I see what is happening, Softimage must be
consolidating something or just getting confused.

I manually edited the parameters in the scripted operator editor... from
Outputs to Outputs.output1 and things started to work. I mean the scop
icons show on the parameters not the property. This code in the scop
works...


if(Out.Index == 2){

Out.Value = 10.0;
}
else{
Out.Value = 11.0;
}


maybe try this in the self-installed custom ops instead?

Steven



On Wed, Jul 22, 2015 at 11:45 AM, Jeremie Passerin gerem@gmail.com
wrote:

 Hey guys !

 We're having issue here creating a simple scripted operator that takes an
 undefined number of float parameters as input and has an undefined number
 of float outputs.
 We are using PortGroups but it's not connecting to the parameter but to
 the property, depsite me passing the parameter.

 Here is a sample python code:


 xsi = Application
 from win32com.client import constants

 xsi.NewScene( None, False )

 prop = xsi.ActiveSceneRoot.AddProperty(CustomProperty, False, Inputs)
 inParam1 = prop.AddParameter3(input1, constants.siDouble, 0 )
 inParam2 = prop.AddParameter3(input2, constants.siDouble, 0 )

 prop = xsi.ActiveSceneRoot.AddProperty(CustomProperty, False, Outputs)
 outParam1 = prop.AddParameter3(output1, constants.siDouble, 0 )
 outParam2 = prop.AddParameter3(output2, constants.siDouble, 0 )

 sop = XSIFactory.CreateScriptedOp( MyOperator, , JScript )
 inputGroup = sop.AddPortGroup( Inputs, 1, 99,  )
 outputGroup = sop.AddPortGroup( Outputs, 1, 99,  )

 sop.AddInputPortByClassID( constants.siParameterID, inputParam,
 inputGroup.Index )
 sop.AddOutputPortByClassID( constants.siParameterID, outputParam,
 outputGroup.Index )


 sop.ConnectToGroup(inputGroup.Index, inParam1)
 sop.ConnectToGroup(outputGroup.Index, outParam1)
 sop.ConnectToGroup(inputGroup.Index, inParam2)


 What are we doing wrong ? any idea ?
 Am I using the right classID ? siParameterID ?

 thanks,
 Jeremie



Siggraph dinner

2015-07-23 Thread Matt Lind
I have arranged a Siggraph dinner for most of the past 15 years, usually on 
Sunday evening to kick off the week as it has the fewest conflicts with other 
Siggraph activities.  It’s a time to put a face to a name, share war stories 
from the studio, and make new connections to build your network.  While most 
attendees are Softimage users, it’s not strictly the case.  I encourage 
students and other guests come along.  The dinner is casual, and everyone pays 
his/her own way.

I typically rotate restaurants each time and pick somewhere nice.  The 
exception being the past few times Siggraph was in Los Angeles with dinner at 
Trader Vic’s.  Well, Trader Vic’s is no more (in LA) .  I have a few 
replacements in mind, but wanted an idea of who would be interested in meeting 
as head count determines whether I have to leave deposits, use fixed menus, and 
so forth.  I would like ball park figures on those details to more quickly rule 
in/out possible restaurants.  Preliminary thinking is someplace in the LA Live 
district immediately north of the convention center, but it only has chain 
restaurants and closes a little earlier being a Sunday.  Alternate choice is 
the Pacific Dining Car on 6th street which is built in a converted railroad car 
and a tad pricey (tourist attraction), but is open 24 hours and food is rated 
as very good.

Date:
Sunday August 9, 2015

Time
Meet and greet: 6:00 pm – closed
Seated for dinner at roughly 7:15 pm

Anybody can show up for meet and greet, but only those who RSVP will be 
seated for dinner.

Where:
TBD based on response.

if you’re interested in attending, send an email to 
matt(dot)lind(at)mantom(dot)net with subject “Siggraph dinner 2015”.  Please 
include the following information with your RSVP:

- your name
- number of guests (including yourself)
- any special needs (food allergies, dietary needs, handicap access, etc...)
- most reliable contact info you can be reached (email/phone/text/...)
(think in terms of when you’re in Los Angeles)

Please only RSVP if you’re sure you want to and can attend.  Late comers are OK 
(to attend technical papers fast forward, for example) as long as you notify me 
in advance.  Whatever you do, don’t RSVP and then not show up.  That leaves me 
and others on the hook for anything reserved and not used.  Don’t be that guy.

thanks,

Matt



Re: Custom Op : Dynamic port connected to float parameters

2015-07-23 Thread Jeremie Passerin
I did that too, but I then tried to connect another parameter by script and
it crashed softimage.
I actually think it might not be supported. I read somewhere in the doc
that PortGroup can be used with Kinematics and Primitives.

*Dynamically Connecting To Groups*

The ConnectToGroup method allows you to add objects to a port group at any
time after it is defined. However, this method can only be used on a port
group containing a single port, and the object passed in the Object argument
must be a specific node (that is, a KinematicState or Primitive rather than
an X3DObject):

On 23 July 2015 at 13:00, Steven Caron car...@gmail.com wrote:

 I loaded your script up and I see what is happening, Softimage must be
 consolidating something or just getting confused.

 I manually edited the parameters in the scripted operator editor... from
 Outputs to Outputs.output1 and things started to work. I mean the scop
 icons show on the parameters not the property. This code in the scop
 works...


 if(Out.Index == 2){

 Out.Value = 10.0;
 }
 else{
 Out.Value = 11.0;
 }


 maybe try this in the self-installed custom ops instead?

 Steven



 On Wed, Jul 22, 2015 at 11:45 AM, Jeremie Passerin gerem@gmail.com
 wrote:

 Hey guys !

 We're having issue here creating a simple scripted operator that takes an
 undefined number of float parameters as input and has an undefined number
 of float outputs.
 We are using PortGroups but it's not connecting to the parameter but to
 the property, depsite me passing the parameter.

 Here is a sample python code:


 xsi = Application
 from win32com.client import constants

 xsi.NewScene( None, False )

 prop = xsi.ActiveSceneRoot.AddProperty(CustomProperty, False, Inputs)
 inParam1 = prop.AddParameter3(input1, constants.siDouble, 0 )
 inParam2 = prop.AddParameter3(input2, constants.siDouble, 0 )

 prop = xsi.ActiveSceneRoot.AddProperty(CustomProperty, False, Outputs)
 outParam1 = prop.AddParameter3(output1, constants.siDouble, 0 )
 outParam2 = prop.AddParameter3(output2, constants.siDouble, 0 )

 sop = XSIFactory.CreateScriptedOp( MyOperator, , JScript )
 inputGroup = sop.AddPortGroup( Inputs, 1, 99,  )
 outputGroup = sop.AddPortGroup( Outputs, 1, 99,  )

 sop.AddInputPortByClassID( constants.siParameterID, inputParam,
 inputGroup.Index )
 sop.AddOutputPortByClassID( constants.siParameterID, outputParam,
 outputGroup.Index )


 sop.ConnectToGroup(inputGroup.Index, inParam1)
 sop.ConnectToGroup(outputGroup.Index, outParam1)
 sop.ConnectToGroup(inputGroup.Index, inParam2)


 What are we doing wrong ? any idea ?
 Am I using the right classID ? siParameterID ?

 thanks,
 Jeremie





Re: Simple question - Dorito setup

2015-07-23 Thread Eric Turman
I am way too tired to make a clean scene let alone a clean script, but this
python script builds a very simple scene that has a dorito deforming a
cloned mesh and being influenced by the driver mesh. The move null
functions like a COG and everything plays nice:

Application.CreatePrim(Sphere, MeshSurface, , )
Application.GetPrim(Null, , , )
Application.SetValue(null.Name, bottom, )
Application.Translate(, 0, -4, 0, siRelative, siParent, siObj,
siXYZ, , , , , , , , , , 0, )
Application.SetValue(bottom.null.shadow_icon, 2, )
Application.SetValue(bottom.null.shadow_scaleY, 0, )
Application.SetValue(bottom.null.primary_icon, 0, )
Application.SetValue(bottom.null.size, 3, )
Application.Duplicate(bottom, , 2, 1, 1, 0, 0, 1, 0, 1, , , , ,
, , , , , , 0)
Application.Translate(, 0, 8, 0, siRelative, siParent, siObj,
siXYZ, , , , , , , , , , 0, )
Application.SetValue(bottom1.Name, top, )
Application.SelectObj(sphere, , True)
Application.Clone(, , 1, 1, 0, 0, 1, 0, 1, , , , , , , ,
, , )
Application.SelectObj(sphere, , )
Application.SetValue(sphere.Name, driver, )
Application.SelectObj(sphere1, , )
Application.SetValue(sphere1.Name, clone, )
Application.SelectObj(driver, , )
Application.ApplyFlexEnv(driver;bottom,top, , 2)
Application.GetPrim(Null, , , )
Application.SetValue(null.Name, clusterConstrainedNull, )
Application.GetPrim(Null, , , )
Application.SetValue(null.Name, dorito, )
Application.SetValue(dorito.null.primary_icon, 0, )
Application.SetValue(dorito.null.shadow_icon, 8, )
Application.SetValue(dorito.null.shadow_scaleX, 0, )
Application.SelectObj(clusterConstrainedNull, , )
Application.SelectObj(clone, , )
Application.ToggleVisibility(, , )
Application.SelectObj(clusterConstrainedNull, , )
Application.ApplyCns(ObjectToCluster, clusterConstrainedNull,
driver.pnt[19], )
Application.SetValue(clusterConstrainedNull.kine.objclscns.tangent, True,
)
Application.SetValue(clusterConstrainedNull.kine.objclscns.upvct_active,
True, )
Application.SelectObj(dorito, , )
Application.ParentObj(B:clusterConstrainedNull, dorito)
Application.SelectObj(B:clusterConstrainedNull, , )
Application.SelectObj(dorito, , )
Application.ResetTransform(, siObj, siSRT, siXYZ)
Application.GetPrim(Null, , , )
Application.SetValue(null.Name, move, )
Application.SetValue(move.null.primary_icon, 0, )
Application.SetValue(move.null.shadow_icon, 2, )
Application.SetValue(move.null.shadow_scaleY, 0, )
Application.SetValue(move.null.size, 5, )
Application.SelectObj(bottom, , )
Application.ToggleSelection(top, , )
Application.ParentObj(B:move, bottom,top)
Application.SelectObj(B:move, , )
Application.DeselectAll()
Application.SelectObj(bottom, , )
Application.SelectObj(bottom,top, , )
Application.SetNeutralPose(, siSRT, )
Application.SelectObj(move, , )
Application.AddProp(Display Property, , , , )
Application.SetValue(move.display.wirecolorr, 0.381, )
Application.SetValue(move.display.wirecolorg, 0.381, )
Application.SetValue(move.display.wirecolorb, 0.381, )
Application.SetValue(move.display.wirecolorr, 0.76, )
Application.SetValue(move.display.wirecolorg, 0, )
Application.SetValue(move.display.wirecolorb, 0, )
Application.SetValue(move.display.wirecolorr, 0.110376, )
Application.SetValue(move.display.wirecolorg, 0.756, )
Application.SetValue(move.display.wirecolorb, 0, )
Application.GetPrim(Null, , , )
Application.SetValue(null.Name, noDeform, )
Application.ApplyCns(Pose, noDeform, move, )
Application.SelectObj(clusterConstrainedNull, , )
Application.SelectObj(dorito, , )
Application.SelectObj(move, , True)
Application.SelectObj(driver, , True)
Application.ToggleVisibility(, , )
Application.SelectObj(clone, , )
Application.ToggleVisibility(, , )
Application.ApplyFlexEnv(clone;noDeform,dorito, , 2)
Application.SetValue(clone.polymsh.cls.EnvelopWeightCls.Envelope_Weights.autoenvassign.defnbskelobj,
1, )
Application.SetValue(clone.polymsh.cls.EnvelopWeightCls.Envelope_Weights.autoenvassign.defnbskelobj,
2, )
Application.SelectObj(noDeform, , )
Application.CopyPaste(move.kine.global.posz, ,
noDeform.Static_KineState.posz, 1)
Application.CopyPaste(move.kine.global.posy, ,
noDeform.Static_KineState.posy, 1)
Application.CopyPaste(move.kine.global.posx, ,
noDeform.Static_KineState.posx, 1)
Application.CopyPaste(move.kine.global.rotz, ,
noDeform.Static_KineState.oriz, 1)
Application.CopyPaste(move.kine.global.roty, ,
noDeform.Static_KineState.oriy, 1)
Application.CopyPaste(move.kine.global.rotx, ,
noDeform.Static_KineState.orix, 1)
Application.CopyPaste(move.kine.global.sclz, ,
noDeform.Static_KineState.sclz, 1)
Application.CopyPaste(move.kine.global.scly, ,
noDeform.Static_KineState.scly, 1)
Application.CopyPaste(move.kine.global.sclx, ,
noDeform.Static_KineState.sclx, 1)
Application.SelectObj(dorito, , True)
Application.CopyPaste(clusterConstrainedNull.kine.global.posz, ,
dorito.Static_KineState.posz, 1)
Application.CopyPaste(clusterConstrainedNull.kine.global.posy, ,
dorito.Static_KineState.posy, 1)

Re: How to clear operators from an object without applying?

2015-07-23 Thread pedro santos
Hi Martin
Thanks again for coming up with a solution, this works great! I changed it
a bit to add a integer stack selection. I was actually surprised it ran the
function before it was defined unlike Python :) Problem is I don't know JS
:P So I tried to loop over selection with no avail. I noticed that if I
had several objects selected used selection(0) or selection(1) it did
something accordingly, but apparently I can not use .lenght to define a
loop duration: // ERROR : Object doesn't support this property or method -
[line 30]

I don't know how to loop it... Well, I cal set a fixed number like 999 in
 for (var i = 0; i  selection.length; i++) { and just cope with the out of
range error :)

Thanks
Pedro

// JScript

function delOps(oObj){
var oOpColl = new ActiveXObject( XSI.Collection );
var oOpStack = new Enumerator( oObj.ActivePrimitive.ConstructionHistory );
 for (;!oOpStack.atEnd();oOpStack.moveNext()){
if (oOpStack.item().name == stack){
var ModelingFlag = 1;
continue;
}
if (ModelingFlag == 1){
oOpColl.add (oOpStack.item());
}
}
 if (oOpColl.Count0) DeleteObj( oOpColl ) ;
}

var pickstack = 2;
var stack = [Modeling, Shape Modeling, Animation, Secondary Shape
Modeling][pickstack];


//Loop Attempt #1
for (i in selection) {
delOps(i);
}

//Loop Attempt #1
for (var i = 0; i  selection.length; i++) { // Throws error that selection
doesn't support .length
delOps(selection(i));
}

On Thu, Jul 23, 2015 at 10:17 AM, Martin Yara furik...@gmail.com wrote:

 Just delete them? Or you mean by script

 I wrote something similar in JScript to freeze some operators under
 certain stack. I just changed it to delete all operators below the Modeling
 Stack. It only works with 1 object, you'll need to add a loop.

 // JScript

 delOps(selection(0))

 function delOps(oObj){
 var oOpColl = new ActiveXObject( XSI.Collection );
 var oOpStack = new Enumerator( oObj.ActivePrimitive.ConstructionHistory );
  for (;!oOpStack.atEnd();oOpStack.moveNext()){
 if (oOpStack.item().name == Modeling){
 var ModelingFlag = 1;
 continue;
 }
 if (ModelingFlag == 1){
 oOpColl.add (oOpStack.item());
 }
 }
  if (oOpColl.Count0) DeleteObj( oOpColl ) ;
 }


 Martin


 On Thu, Jul 23, 2015 at 5:47 PM, pedro santos probi...@gmail.com wrote:




 *HiQuite a few times when I'm adding operators to multiple objects I
 would also like to clear those objects of any operator. This is not
 Freezing, as I do not want to apply those operators, but remove them. More
 over if the above is possible, is it also possible to remove operators only
 from the modeling stack? Alike one uses Freeze and Freeze modeling
 differently?Thanks*
 *Pedro*





-- 




*--[image:
http://i153.photobucket.com/albums/s202/animatics/probiner-sig.gif]Pedro
Alpiarça dos Santos Animator  3DModeler  Illustrator 
http://probiner.x10.mx/ http://probiner.x10.mx/*


Re: How to clear operators from an object without applying?

2015-07-23 Thread Martin Yara
Just delete them? Or you mean by script

I wrote something similar in JScript to freeze some operators under certain
stack. I just changed it to delete all operators below the Modeling Stack.
It only works with 1 object, you'll need to add a loop.

// JScript

delOps(selection(0))

function delOps(oObj){
var oOpColl = new ActiveXObject( XSI.Collection );
var oOpStack = new Enumerator( oObj.ActivePrimitive.ConstructionHistory );
 for (;!oOpStack.atEnd();oOpStack.moveNext()){
if (oOpStack.item().name == Modeling){
var ModelingFlag = 1;
continue;
}
if (ModelingFlag == 1){
oOpColl.add (oOpStack.item());
}
}
 if (oOpColl.Count0) DeleteObj( oOpColl ) ;
}


Martin


On Thu, Jul 23, 2015 at 5:47 PM, pedro santos probi...@gmail.com wrote:




 *HiQuite a few times when I'm adding operators to multiple objects I would
 also like to clear those objects of any operator. This is not Freezing, as
 I do not want to apply those operators, but remove them. More over if the
 above is possible, is it also possible to remove operators only from the
 modeling stack? Alike one uses Freeze and Freeze modeling
 differently?Thanks*
 *Pedro*