Re: Envelope normalising tool??

Date : Wed, 14 Mar 2007 16:30:52 -0700
To : XSI(at)Softimage.COM
From : Adam Sale <adamsale(at)shaw.ca>
Subject : Re: Envelope normalising tool??
you could find yourself shelling out bucks man...
ice water these days is starting to rival the cost of a forthy pint..

unless of course you're in Canada... eh..

----- Original Message -----
From: Bradley Gabe <withanar(at)stanwinston.com>
Date: Wednesday, March 14, 2007 1:21 pm
Subject: Re: Envelope normalising tool??

> No fee necessary. My payment is that justice has been done. A 
> round of
> ice water for everyone, my treat!
> 
> > yeah Brad.. if only you had attached some sort of fee per 
> post... the Gabe Toll. 
> > 
> > Adam
> > 
> > ----- Original Message -----
> > From: Bradley Gabe <withanar(at)stanwinston.com>
> > Date: Wednesday, March 14, 2007 10:29 am
> > Subject: Re: Envelope normalising tool??
> > 
> > > Is anyone else keeping score? My list posting technique has 
> done a lot
> > > of good for a lot of people since I started counting.
> > > 
> > > > Cool thanks lots - it turned out that the env op had become 
> a 
> > > little 
> > > > unstable - saved the weights out, re-enveloped, loaded the 
> save 
> > > weight 
> > > > preset - all happy again!!
> > > > 
> > > > Thanks again
> > > > 
> > > > Sandy
> > > > 
> > > > ----------------------------------------------------------
> > > > Sandy Sutherland  Digital Doodeller - TD
> > > > Blackginger (Cape)  http://www.blackginger.tv
> > > > mailto:sandy(at)blackginger.tv
> > > > (P) (+27 21) 488 1188  (Cel) 0827893789
> > > > ----------------------------------------------------------
> > > > ----- Original Message ----- 
> > > > From: "Francois Lord" <francoislord(at)gmail.com>
> > > > To: <XSI(at)Softimage.COM>
> > > > Sent: Wednesday, March 14, 2007 4:55 PM
> > > > Subject: Re: Envelope normalising tool??
> > > > 
> > > > 
> > > > > Here is one, it's in Python.
> > > > >
> > > > >
> > > > >
> > > > > Sandy Sutherland wrote:
> > > > >> Hi All - we have a little problem here - one of the guys 
> has been
> > > > >> rigging a character and has found that some of the points 
> are 
> > > not 100%
> > > > >> weighted - anyone got a tool that can correct this - i 
> have 
> > > tried the
> > > > >> one on XSIbase, but it errors out
> > > > >>
> > > > >> 'ERROR : Object required: 'objenvelope.Model' - [line 39 in
> > > > >> w:\workgroup_5\data\scripts\Envelope_Checker.vbs]
> > > > >>
> > > > >> EnvelopeChecker
> > > > >>
> > > > >> We are on 5.11 BTW
> > > > >>
> > > > >> Thanks
> > > > >>
> > > > >> Sandy
> > > > >>
> > > > >> ----------------------------------------------------------
> > > > >> Sandy Sutherland  Digital Doodeller - TD
> > > > >> Blackginger (Cape)  http://www.blackginger.tv
> > > > >> mailto:sandy(at)blackginger.tv
> > > > >> (P) (+27 21) 488 1188  (Cel) 0827893789
> > > > >> ----------------------------------------------------------
> > > > >
> > > > 
> > > > 
> > > > -------------------------------------------------------------
> ----
> > > ---------------
> > > > 
> > > > 
> > > > > from buzz.xsi import *
> > > > > import win32com.client
> > > > >
> > > > > iModified = 0
> > > > > oDeformer = xsi.PickElement(c.siObjectFilter, "Pick 
> deformer")(2)> > > >
> > > > > for oObj in xsi.Selection:
> > > > > if xsi.ClassName(oObj) != "X3DObject":
> > > > > log(oObj.FullName +" is not an X3DObject.",2)
> > > > > continue
> > > > > try:
> > > > > oEnvelope = oObj.ActivePrimitive.NestedObjects("Envelope 
> > > Operator")> > except:
> > > > > log(oObj.FullName + " doesn't have an envelope operator.",2)
> > > > > continue
> > > > > if not oEnvelope:
> > > > > log(oObj.FullName + " doesn't have an envelope operator.",2)
> > > > > continue
> > > > >
> > > > > Application.FreezeObj(oObj.Fullname + 
> > > ".polymsh.cls.*.Envelope_Weights", 
> > > > > "", "")
> > > > > tW = oEnvelope.Weights.Array
> > > > >
> > > > > # Find where is the picked deformer in the Weights Array.
> > > > > oDeformersColl = oEnvelope.Deformers
> > > > > for i in range(oDeformersColl.Count):
> > > > > if oDeformersColl(i).FullName == oDeformer.FullName:
> > > > > break
> > > > > else: # Picked object is not deformer
> > > > > log(oDeformer.FullName + " is not currently a deformer for 
> > > object: " + 
> > > > > oObj.FullName + ". Skipping object.",2)
> > > > > continue
> > > > > iDeformerPos = i
> > > > >
> > > > > # Inverse the two dimentions of the tuple so that we can 
> work 
> > > on points, 
> > > > > not deformers.
> > > > > lWeights = [[r[column] for r in tW] for column in 
> > > range(len(tW[0]))]> >
> > > > > # For each point, calculate the total weight value.
> > > > > for iPoint in range(len(lWeights)):
> > > > > fTotalValue = 0
> > > > > for iDeformer in range(len(lWeights[0])):
> > > > > fTotalValue = fTotalValue + lWeights[iPoint][iDeformer]
> > > > >
> > > > > # Isolate vertices with less than 100% weight.
> > > > > # Due to a float precision error, most points are not 
> exactly 
> > > at 100%, we 
> > > > > must accept a somewhat wider range.
> > > > > if fTotalValue < 99.9999:
> > > > > # Set point weight for picked deformer at 100 - 
> fTotalvalue 
> > > (the missing 
> > > > > part).
> > > > > lWeights[iPoint][iDeformerPos] = 
> > > lWeights[iPoint][iDeformerPos] + 100 - 
> > > > > fTotalValue
> > > > > iModified = iModified + 1
> > > > >
> > > > > # Revert back the two dimensions of the tuple and assign.
> > > > > if iModified:
> > > > > tNewW = [[r[column] for r in lWeights] for column in 
> > > > > range(len(lWeights[0]))]
> > > > > oEnvelope.Weights.Array = tNewW
> > > > > sFormat = "%s: %d points (%.1f%%) have been modified"
> > > > > log(sFormat % (oObj.FullName, iModified, iModified / 
> > > > > float(len(lWeights))*100))
> > > > >
> > > > > Application.FreezeObj(oObj.Fullname + 
> > > ".polymsh.cls.*.Envelope_Weights", 
> > > > > "", "")
> > > > > 
> > > > 
> > > > ---
> > > > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following 
> > > text in body:
> > > > unsubscribe xsi
> > > 
> > > ---
> > > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following 
> text 
> > > in body:
> > > unsubscribe xsi
> > > 
> > ---
> > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following 
> text in body:
> > unsubscribe xsi
> 
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text 
> in body:
> unsubscribe xsi
> 
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.