passing arrays as SCOP userdata from _INIT-function to UPDATE-function
| Date : Wed, 04 Oct 2006 18:19:12 +0200 |
| To : XSI(at)Softimage.COM |
| From : Philipp Oeser <philipp.oeser(at)liga01.de> |
| Subject : passing arrays as SCOP userdata from _INIT-function to UPDATE-function |
In a SCOP I'm trying to set some userdata in the operator's _INIT function and read it back in the operator's _UPDATE-function.
Everything works fine when I use simple types such as ints, but I'm stuck when I want to pass arrays. Just dont know how to read them back in... :-[
How can I cast this back to a "normal" array? It always gives me some type mismatch...
Can you help me?
Thanx Philipp Oeser
++++++++++++++ C O D E +++++++++++++++++++++++++ function liDistributePointsOP_Init(in_context)
set oInputPort = in_context.Operator.InputPorts(0)
dim aOldPositions()
redim aOldPositions(2, oInputPort.value.Elements.Count)
'...........................................................................................
'...........................................................................................
' Cache the original Vertex positions to be able to blend between original and new positions
' in the operators update function
'...........................................................................................
'...........................................................................................
for n=0 to (oInputPort.value.Elements.Count-1)
aOldPositions(0, n) = oInputPort.value.Parent.Points(oInputPort.value.Elements.Item(n)).position.X
aOldPositions(1, n) = oInputPort.value.Parent.Points(oInputPort.value.Elements.Item(n)).position.Y
aOldPositions(2, n) = oInputPort.value.Parent.Points(oInputPort.value.Elements.Item(n)).position.Z
next
'...........................................................................................
'...........................................................................................
' Now pass the old positions as userdata to the updatefunction
'...........................................................................................
'...........................................................................................
in_context.Userdata = aOldPositions end function
function liDistributePointsOP_Update(In_UpdateContext, out, inout)
dim aOldPositions2()
redim aOldPositions2(2, inout.value.Elements.Count)aOldPositions2 = In_UpdateContext.Userdata ???
. . .
++++++++++++++ C O D E +++++++++++++++++++++++++ --- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi
- Follow-Ups:
- Re: passing arrays as SCOP userdata from _INIT-function to UPDATE-function
- From: dbarosin(at)optonline.net
- Re: passing arrays as SCOP userdata from _INIT-function to UPDATE-function
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: doing something different with Custom FX Operators
- Next by Date: doing something different with Custom FX Operators
- Previous by Thread: doing something different with Custom FX Operators
- Next by Thread: doing something different with Custom FX Operators
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |