As noted in many past threads, Python is kind of shoe-horned into Softimage and doesn't have the same level of integration as VBScript or Jscript.

The source of the problem is likely related to having to call Envelope.GetWeights2() instead of Envelope.Weights. It may produce the same end result, but the path to get there is different likely involving extra memory allocation to get the envelope weight data on top of what is handed to your calling code. Under most conditions that is not a problem, but yours is a bit extreme. I would look at trimming the envelope before resorting to code modification, but assuming you cannot do so...

A plugin in another language should be fairly trivial such as this:

function GetEnvelopeWeightsData_Execute( oEnvelope, oWeightData )
{
   oWeightData.Data = oEnvelope.Weights.Array.toArray();
}

or

Function GetEnvelopeWeightsData_Execute oEnvelope, oWeightData
   oWeightData.Data = oEnvelope.Weights.Array
end Function


oWeightData would be a pointer to a GridData object and passed into the plugin via the siDispatch classification so it is not converted or modified in any way by Softimage at invocation of the plugin. I suggest GridData because it has methods to work with rows and columns much like the Envelope object, and can easily dump the data back into the envelope via oEnvelope.Weights.Array = oWeightData.Data, thus simplifying your code and avoiding the need to convert between data types.

Just a suggestion, you can do what you like.


Matt





Date: Fri, 30 Oct 2015 16:12:19 -0400
From: Eric Thivierge <[email protected]>
Subject: Re: Envelope Weights Array, out of memory error
To: "[email protected]"

Steve, yes that was my thought to do that by iterating over each and
building up the numpy array. Usually I can just dump the Weights.Array into
numpy.array() but I can't even get to that point yet because of casting
into a Python tuple or list or whatever. I'll give that a shot.

Matt, I don't need to be jumping through more hoops and crossing the
streams with intermingled JScript / VBScript plug-ins. You may have a
point, maybe one of those languages handles the amount of data better
though.

I have tried splitting the calls separately but that doesn't help either.
:\

Thanks for the tips, will tinker.

Eric T.

--------------------------------------------
Eric Thivierge
http://www.ethivierge.com

Reply via email to