Re: Slow Reading / Writing Envelope.Weights.Array

2013-06-03 Thread Jeremie Passerin
woow ! Pretty cool Jo ! I wish I could do python like that. That would speed up some of my tools ;-) On 1 June 2013 20:22, Eric Thivierge wrote: > Yes the performance of the Array property. Interacting with it is > abysmally slow on meshes with large point counts and large number of items > use

Re: Slow Reading / Writing Envelope.Weights.Array

2013-06-01 Thread Eric Thivierge
Yes the performance of the Array property. Interacting with it is abysmally slow on meshes with large point counts and large number of items used in its envelope. Thanks for the thorough examples exploring the other aspects. Should be good stuff to take a look at and learn from. Eric T. On Sat,

Re: Slow Reading / Writing Envelope.Weights.Array

2013-06-01 Thread jo benayoun
Hey Eric, I must confess that I am quite confused by this thread as I can't figure out what this is really about... * performance of the Array property? >>> env_weights = envelope.Weights.Array # 7.18513235319 This is something on which we don't really have control over... well, seems like

Re: Slow Reading / Writing Envelope.Weights.Array

2013-06-01 Thread Bartosz Opatowiecki
W dniu 2013-05-31 15:29, Eric Thivierge pisze: I really seems the slowness is simply accessing envelopeOp.Weights.Array. Indeed, you are right. Bartek Opatowiecki

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-31 Thread Raffaele Fragapane
The trick to that is numpy.asarray(aWeights) ;) On Sat, Jun 1, 2013 at 1:15 PM, Eric Thivierge wrote: > It's very dense geo probably no where near the gorgo though. It's just the > Softimage default xsi man armored. The body mesh local subdivided and > fetching from there. > > In my previous po

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-31 Thread Eric Thivierge
It's very dense geo probably no where near the gorgo though. It's just the Softimage default xsi man armored. The body mesh local subdivided and fetching from there. In my previous posts it's simply the data fetch that is taking 6 seconds. The other processes aren't taking too long regardless. I w

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-31 Thread Raffaele Fragapane
You should use numpy regardless, because all operations you will need to work on after you pull will be A TON faster. So start from there. As for the time it takes, what's the size of the table we're talking about? The data fetching stage for the HR Gorgo (the only one I tested when I refactored th

RE: Slow Reading / Writing Envelope.Weights.Array

2013-05-31 Thread Matt Lind
Subject: Re: Slow Reading / Writing Envelope.Weights.Array This takes even longer ~ 14 seconds. I really seems the slowness is simply accessing envelopeOp.Weights.Array. Any devs paying attention that could confirm that this is just a slow call? Would doing these operations in C++ be the only

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-31 Thread Eric Thivierge
I don't necessarily need to pass them back to Python honestly so this is probably the plan for now. Eric Thivierge === Character TD / RnD Hybride Technologies On 31/05/2013 1:09 PM, Steven Caron wrote: ya, if performance is key i would use cpp or vb and make a command... but

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-31 Thread Steven Caron
ya, if performance is key i would use cpp or vb and make a command... but you might run right back into issues passing the data back into python. On Fri, May 31, 2013 at 6:29 AM, Eric Thivierge wrote: > Would doing these operations in C++ be the only way to speed them up? > >

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-31 Thread Alan Fregtman
Here's another way to read weights. Not sure if it's faster. Probably not. xsi = Application obj = xsi.Selection(0) envCls = obj.ActivePrimitive.Geometry.Clusters(0) envProp = envCls.Properties(0) # Envelope ICE attrs:# EnvelopeWeights, EnvelopeWeightsPerDeformer, EnvelopeDeformerIndices, NbDeform

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-31 Thread Bartosz Opatowiecki
What do you mean by "high point count / high deformer count meshes." ? Bartek Opatowiecki W dniu 2013-05-31 15:29, Eric Thivierge pisze: This takes even longer ~ 14 seconds. I really seems the slowness is simply accessing envelopeOp.Weights.Array. Any devs paying attention that could confirm

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-31 Thread Martin
Have you tried VBScript? I usually do my envelope related scripts in VBScript because it is way faster than JScript (my main scripting language). VBScript selection(0).Envelopes(0).Weights.Array is faster than JScript new VBArray( selection(0).Envelopes(0).Weights.Array ) and way way more faste

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-31 Thread Eric Thivierge
This takes even longer ~ 14 seconds. I really seems the slowness is simply accessing envelopeOp.Weights.Array. Any devs paying attention that could confirm that this is just a slow call? Would doing these operations in C++ be the only way to speed them up? # Python # =

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-31 Thread Bartosz Opatowiecki
Also: def getWeights(envelopeOp): weightsTuple = envelopeOp.Weights.Array return [weightsTuple[j][i] for i in range(len(weightsTuple[0])) for j in range(len(weightsTuple))] xrange should be more efficient than range W dniu 2013-05-31 00:44, Eric Thivierge pisze: On Thu, May 30, 2013 at

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Xavier Lapointe
Or our lovely RunSnakeRun (cProfile like Bartosz mentioned): http://www.vrplumber.com/programming/runsnakerun/

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Bartosz Opatowiecki
Hi Eric, Why don't you use cProfile module to find slowest part of that code ? Also KCacheGrind is cool if you like visual feedback. Bartek Opatowiecki W dniu 2013-05-31 00:44, Eric Thivierge pisze: On Thu, May 30, 2013 at 6:35 PM, Alok Gandhi > wrote: Ma

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Eric Thivierge
On Thu, May 30, 2013 at 6:35 PM, Alok Gandhi wrote: > Maybe you can still get some optimization using numpy, I think. Throw your > weights array directly into numpy. It is worth a try at least. I'll give it a shot tomorrow. :) Eric Thivierge http://w

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Alok Gandhi
Maybe you can still get some optimization using numpy, I think. Throw your weights array directly into numpy. It is worth a try at least. Sent from my iPhone On 2013-05-30, at 4:59 PM, Eric Thivierge wrote: > Thanks Alok, > > I do not think that the slowness is from converting the tuple to li

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Jens Lindgren
I just tried these examples myself. Got 4.5 seconds with Erics example and 4.6 seconds with map(). Using Soft 2014 on Windows 8. It took longer time to subdivide the mesh. /Jens On Thu, May 30, 2013 at 11:14 PM, Eric Thivierge wrote: > Same time for me. 6 seconds. > > > Eric Thivierge > ==

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Alan Fregtman
Weird. Maybe it's cause I'm on Linux? On Thu, May 30, 2013 at 5:14 PM, Eric Thivierge wrote: > Same time for me. 6 seconds. > > > Eric Thivierge > === > Character TD / RnD > Hybride Technologies > > On 30/05/2013 5:02 PM, Alan Fregtman wrote: > >> map(list, sel(0).Envelopes(0).Weig

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Eric Thivierge
Same time for me. 6 seconds. Eric Thivierge === Character TD / RnD Hybride Technologies On 30/05/2013 5:02 PM, Alan Fregtman wrote: map(list, sel(0).Envelopes(0).Weights.Array)

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Alan Fregtman
You can convert it much faster with: weights = map(list, sel(0).Envelopes(0).Weights.Array) In my box here at work it went from 17.81 seconds down to 7.9s with the line above. On Thu, May 30, 2013 at 4:59 PM, Eric Thivierge wrote: > Thanks Alok, > > I do not think that the slowness is from

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Eric Thivierge
Thanks Alok, I do not think that the slowness is from converting the tuple to lists more that the access time to the Weights.Array is slow as I see the slowness (~5 seconds) when I don't even convert it. Eric Thivierge === Character TD / RnD Hybride Technologies On 30/05/20

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Alok Gandhi
Use numpy : http://www.numpy.org/ On Thu, May 30, 2013 at 4:42 PM, Eric Thivierge wrote: > Well all my code is doing is creating a list of lists from the weights > array nothing more. > > Should I consider this speed not slow then? When running various tools > that use this call to the weights

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Eric Thivierge
Well all my code is doing is creating a list of lists from the weights array nothing more. Should I consider this speed not slow then? When running various tools that use this call to the weights array it seems extremely slow. Am I just being impatient or on meshes with this density and number

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Jeremie Passerin
just tested your scenario... got the same result here :D Actually your code is faster than mine On 30 May 2013 13:21, Eric Thivierge wrote: > Thanks Jeremie, > > I was referencing your code when I ran into the slowness to see if we are > doing anything different and we aren't really. > > As a

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Eric Thivierge
Thanks Jeremie, I was referencing your code when I ran into the slowness to see if we are doing anything different and we aren't really. As a test I'm grabbing the XSI Man Armored and selecting the body mesh and doing a local subdiv refinement with a setting of 2 then freezing modeling. Then

Re: Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Jeremie Passerin
Writting to the envelope array is usually pretty fast for me... what's taking time (in my case) is doing all the normalization of values... This is how I read my weights : def getWeights(envelopeOp): weightsTuple = envelopeOp.Weights.Array return [weightsTuple[j][i] for i in range(len(weightsTup

Slow Reading / Writing Envelope.Weights.Array

2013-05-30 Thread Eric Thivierge
Anyone know if there is a way to speed up reading and writing speeds to the Weights Array for envelopes? It's extremely slow on high point count / high deformer count meshes. I'm using Python but I'm not sure if that is the reason for the slowness. Anyone else already do some testing or have a