Are you trying to access Parent3DObject from the
operator update callback? The function is blocked in this case to avoid
pulling the graph.
-mab
From: owner-xsi(at)Softimage.COM
[mailto:owner-xsi(at)Softimage.COM] On Behalf Of Steven
Caron
Sent: September 6, 2007 9:05 PM
To:
XSI(at)Softimage.COM
Subject: Re: Parent3DObject property of an operator
doesn't seem to be working.
good enough for me...
cheers!
steven
On 9/6/07, Bernard
Lebel <3dbernard(at)gmail.com>
wrote:
Yeah
I've run into the same problem myself. Unfortunately I didn't
find an
object model way to solve this. I hope there is!
Anyway, my solution
is to work out the X3DObject the operator is
attached to and then get that
object. JScript:
// Get object name
sFullName =
oOperator.fullname;
aFullName = sFullName.split( "." );
aObjectFullName
= aFullName.slice(0, -2);
sObjectFullName = aObjectFullName.join( "."
);
// Get object
oColl = XSIFactory.createobject( "XSI.Collection"
);
oColl.items = sObjectFullName;
oObject = oColl(0);
Hacky,
ugly and dirty, but reliable and adequately
fast.
Bernard
On 9/6/07, Steven Caron <carons(at)gmail.com> wrote:
> i can't
seem to use "operator.Parent3DObject". it seems to be returning
> "None"
for me.. any ideas as to why?
>
> thanks in advance
>
steven
>
> #code
> #imports
> import
win32com.client
> from win32com.client import
constants
>
> #globals
> xsi =
win32com.client.Dispatch( "XSI.Application" ).Application
> xsiColl =
win32com.client.Dispatch ( "XSI.Collection" )
> xsiPrint =
xsi.LogMessage
>
> meshSelect = xsi.Selection
> validMeshes
= xsiColl
> for mesh in meshSelect:
> if
mesh.Type ==
"polymsh":
>
validMeshes.add(mesh)
>
> if validMeshes.Count >
1:
> genOp = xsi.ApplyGenOp ("MeshMerge", "",
validMeshes.GetAsText(), 3,
> "siPersistentOperation",
"siKeepGenOpInputs")(0) #gets the single operator
> from the collection
returned
> xsiPrint(genOp.Parent3DObject )
#returns "None" for me???
> else:
>
xsiPrint("not enough valid
meshes")
>
>
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the
following text in body:
unsubscribe
xsi