Transferring envelope weight to polygon island
-
Pancho
- Posts: 659
- Joined: 19 Sep 2010, 09:28
Transferring envelope weight to polygon island
Well, that's what I need to do. But I don't know how to do it practically.
I'll import polygons strips into XSI (quad poly strips), which will later deform hair guides in Modo via .MDD. The polygon hair guides imported in XSI need to inherit the envelope of the object they are "attachted to/belong to".
Well, in words it would be something like that:
a) Get closest point of polygon island to body surface
b) Get envelope weight of body at closest location
c) Apply envelope weight to whole polygon island
In the end the polygon strips need to deform like the main body does if deformed by bones
I could also use a slight push operator on the body and instead of using a get closest point to surface I could get the points of the polygon islands inside of the body.
Can anybody help me out with this problem?
Cheers
Thomas
I'll import polygons strips into XSI (quad poly strips), which will later deform hair guides in Modo via .MDD. The polygon hair guides imported in XSI need to inherit the envelope of the object they are "attachted to/belong to".
Well, in words it would be something like that:
a) Get closest point of polygon island to body surface
b) Get envelope weight of body at closest location
c) Apply envelope weight to whole polygon island
In the end the polygon strips need to deform like the main body does if deformed by bones
I could also use a slight push operator on the body and instead of using a get closest point to surface I could get the points of the polygon islands inside of the body.
Can anybody help me out with this problem?
Cheers
Thomas
-
gotchee
- Posts: 21
- Joined: 08 Jul 2010, 17:52
- Location: Hamburg, Germany
Re: Transferring envelope weight to polygon island
not quite sure if ICE allows you to get and set envelope weights as it does with weightmap-values...but why don't you just use GATOR? wouldn't that do the trick as well?
cheers, michael
cheers, michael
Optix Digital Pictures http://www.optixdigital.de // http://vimeo.com/optix
-
Chris_TC
- Posts: 411
- Joined: 22 Mar 2010, 16:43
Re: Transferring envelope weight to polygon island
I just tried this really quickly, and you can get + set envelope weights. But you will first have to envelope your polygon strips to the exact same deformers as your main object to generate the attributes.
Make an ICE tree (on the polygon strips) that's above their envelope operator.
Then you can do a Get Closest Location from the strips to the main object, and plug the output of Get Closest Location into <<Get cls.EnvelopWeightCls.Envelope_Weights.EnvelopeWeightsPerDeformer>> which plugs into <<Set self.cls.EnvelopWeightCls.Envelope_Weights.EnvelopeWeightsPerDeformer>>
Make an ICE tree (on the polygon strips) that's above their envelope operator.
Then you can do a Get Closest Location from the strips to the main object, and plug the output of Get Closest Location into <<Get cls.EnvelopWeightCls.Envelope_Weights.EnvelopeWeightsPerDeformer>> which plugs into <<Set self.cls.EnvelopWeightCls.Envelope_Weights.EnvelopeWeightsPerDeformer>>
-
Pancho
- Posts: 659
- Joined: 19 Sep 2010, 09:28
Re: Transferring envelope weight to polygon island
Wow, that sounds like a good start!
I'll give it a try. The only problem that remains is how to do this for each polygons island (hair guide/polygon strip). Each strip needs to inherit the same enelope as its base (closest to surface) does. Otherwise I could apply a hull deformer to the guides. But this will cause big problems in areas like the neck or the armpits as sometimes the tip of a hair guide will be so close to another part of the body, so this guide will be stretched during animation.
I just wonder whether I can "remove" this ICE tree after applying it or whether the envelopes will be lost if I do this. Anyway, the guides need to keep the envelope weight from frame zero (or 1). Otherwise the animation will be screwed up.
Thanks so far!
I'll give it a try. The only problem that remains is how to do this for each polygons island (hair guide/polygon strip). Each strip needs to inherit the same enelope as its base (closest to surface) does. Otherwise I could apply a hull deformer to the guides. But this will cause big problems in areas like the neck or the armpits as sometimes the tip of a hair guide will be so close to another part of the body, so this guide will be stretched during animation.
I just wonder whether I can "remove" this ICE tree after applying it or whether the envelopes will be lost if I do this. Anyway, the guides need to keep the envelope weight from frame zero (or 1). Otherwise the animation will be screwed up.
Thanks so far!
-
Chris_TC
- Posts: 411
- Joined: 22 Mar 2010, 16:43
Re: Transferring envelope weight to polygon island
If you need to assign the weights per island it gets more complicated. You'll first have to figure out which point of the island is closest to the surface. Then read out the weights at that surface position and assign them to all points of the island.
You may actually have to use the 2d array nodes because each point returns multiple weights (unless you've specified only 1 deformer per point).
You may actually have to use the 2d array nodes because each point returns multiple weights (unless you've specified only 1 deformer per point).
-
Pancho
- Posts: 659
- Joined: 19 Sep 2010, 09:28
Re: Transferring envelope weight to polygon island
In an abstract way; i could express what I need to do. Like you just said. Practically I don't know yet how to determin what is a poygon island and how to cycle through all of them and apply the envelope.
I just started to build up an example rig and implement all you proposed yet. For the rest I'd be more than glad if somebody could point me in the correct direction. Especially what you said about there array isn't quite clear to me.
I just started to build up an example rig and implement all you proposed yet. For the rest I'd be more than glad if somebody could point me in the correct direction. Especially what you said about there array isn't quite clear to me.
-
Pancho
- Posts: 659
- Joined: 19 Sep 2010, 09:28
Re: Transferring envelope weight to polygon island
O.k. So far I did what you did have in mind and it works for the closest point/points. In case there are more points with the same distance to the body each point inherits the envelopes from the body. As these points are in slightly different positions; I would need to choose one of them.
On the "Get closest location on geometry" node I need to enable the cut off distance, otherwise all of them get the envelope from the body mesh.
I searched for ways to get the actual point which is closest to the mesh and then find all the neighbouring points and apply the same weights, but didn't succeed yet.
Though I found the Get Neighbours Plus node from Julian Johnson. This might help to easily get all the connected points.
Anybody who's able to help me get this going?
Thanks so far!
Cheers
On the "Get closest location on geometry" node I need to enable the cut off distance, otherwise all of them get the envelope from the body mesh.
I searched for ways to get the actual point which is closest to the mesh and then find all the neighbouring points and apply the same weights, but didn't succeed yet.
Though I found the Get Neighbours Plus node from Julian Johnson. This might help to easily get all the connected points.
Anybody who's able to help me get this going?
Thanks so far!
Cheers
-
Chris_TC
- Posts: 411
- Joined: 22 Mar 2010, 16:43
Re: Transferring envelope weight to polygon island
I think the biggest issue is figuring out which points belong to an island. Doing this is likely a pretty slow process because there is no simple point attribute that can be read out.
Guillaume has some info on his blog, but after skimming through the posts it does not appear that he explains how the "Get Lowest Point Index By Islands” compound works.
http://frenchdog.wordpress.com/2010/03/ ... int-index/
http://frenchdog.wordpress.com/2010/03/ ... ex-part-2/
http://frenchdog.wordpress.com/2010/03/ ... ng-arrays/
This is the mailing list post where the compound was posted. But it's not online anymore.
http://groups.google.com/group/xsi_list ... dd20e63994
Guillaume has some info on his blog, but after skimming through the posts it does not appear that he explains how the "Get Lowest Point Index By Islands” compound works.
http://frenchdog.wordpress.com/2010/03/ ... int-index/
http://frenchdog.wordpress.com/2010/03/ ... ex-part-2/
http://frenchdog.wordpress.com/2010/03/ ... ng-arrays/
This is the mailing list post where the compound was posted. But it's not online anymore.
http://groups.google.com/group/xsi_list ... dd20e63994
-
Pancho
- Posts: 659
- Joined: 19 Sep 2010, 09:28
Re: Transferring envelope weight to polygon island
Yeah! Stumbled across this too. But there seems to be a logical step missing between Part 1 and 2. At least the information I needs seems to be lacking.
-
Mathaeus
- Posts: 1778
- Joined: 08 Jun 2009, 19:11
- Location: Zagreb, Croatia
Re: Transferring envelope weight to polygon island
An 'old fashion' way for this, not so fast for always live operator. But speed shouldn't be a problem, because you can freeze envelope weights at the end of day.
Before transferring the envelope weights via 'get closest location', you assign a 'some point ID as island ID' as a custom attribute. As you said, you can 'push' your head model a bit.
By 'point in volume' geo query, you make a difference, what is inside, holds an original point ID, what is outside, gets some 'impossible low' ID (here it is -1). Now you just spread a highest value across the mesh - you'll need to repeat as many times as your strip has subdivisions ( along length).
Once you set the custom 'in volume point ID as island ID', you use 'ID to location' or 'point ID to location' to assign an array of weights you got by 'get closest location' - or GATOR. Maybe you'll need an additional 'get closest points' in order to get it to work - I'm not sure how does it exactly works in latest SI versions.
ice tree
Before transferring the envelope weights via 'get closest location', you assign a 'some point ID as island ID' as a custom attribute. As you said, you can 'push' your head model a bit.
By 'point in volume' geo query, you make a difference, what is inside, holds an original point ID, what is outside, gets some 'impossible low' ID (here it is -1). Now you just spread a highest value across the mesh - you'll need to repeat as many times as your strip has subdivisions ( along length).
Once you set the custom 'in volume point ID as island ID', you use 'ID to location' or 'point ID to location' to assign an array of weights you got by 'get closest location' - or GATOR. Maybe you'll need an additional 'get closest points' in order to get it to work - I'm not sure how does it exactly works in latest SI versions.
ice tree
Last edited by Mathaeus on 28 Aug 2011, 20:14, edited 1 time in total.
-
Hirazi Blue
- Administrator
- Posts: 5113
- Joined: 04 Jun 2009, 10:15
Re: Transferring envelope weight to polygon island
Removed my earlier post after seeing how "easy" Mathaeus makes it look, making my remark about over-complicating things sound misplaced. But I still believe scripting shouldn't be ruled out for tasks like this either.
Stay safe, sane & healthy!
-
Mathaeus
- Posts: 1778
- Joined: 08 Jun 2009, 19:11
- Location: Zagreb, Croatia
Re: Transferring envelope weight to polygon island
I agree - but it seems some people (like me) already lost the some parts of brain, related to writingHirazi Blue wrote:But I still believe scripting shouldn't be ruled out for tasks like this either.
-
Pancho
- Posts: 659
- Joined: 19 Sep 2010, 09:28
Re: Transferring envelope weight to polygon island
Feel free to use and change it as you like. Thanks for the great help!
One thing remains unknown. How do I "freeze" the envelope on the guides? I tried to copy a version of the guides, deleted the ICE tree on this object and tried to use GATOr to apply the weights from the ICE guides. Didn't work.
So?!
One thing remains unknown. How do I "freeze" the envelope on the guides? I tried to copy a version of the guides, deleted the ICE tree on this object and tried to use GATOr to apply the weights from the ICE guides. Didn't work.
So?!
You do not have the required permissions to view the files attached to this post.
-
Mathaeus
- Posts: 1778
- Joined: 08 Jun 2009, 19:11
- Location: Zagreb, Croatia
Re: Transferring envelope weight to polygon island
for freezing, in Explorer, go to envelope weight cluster, ('envelopeweightcls' or something), RMB on ICE operator bellow, freeze it. This should freeze 'master' ICE op too (but won't freeze ops bellow ICE tree, if you already have some). I had ICE op bellow the Envelope operator.
-
Pancho
- Posts: 659
- Joined: 19 Sep 2010, 09:28
Re: Transferring envelope weight to polygon island
Yippi-eii-yeah!!!
Thanks sooo much!
The only thing I have to figure out is whether it is possible in Modo or LW to identify the root of the hair guide and assign some kind of cluster information to it which loads into SI. Then I could bring in an if node which checks if the point which inside the volume is although a root "member". In the case there are too many guides which might stick with there tip into geometry and you don't notice it, one could avoid unwanted transformations.
But it's great to be able to have the hair guides deform correctly now!
Cheers
Thomas
Thanks sooo much!
The only thing I have to figure out is whether it is possible in Modo or LW to identify the root of the hair guide and assign some kind of cluster information to it which loads into SI. Then I could bring in an if node which checks if the point which inside the volume is although a root "member". In the case there are too many guides which might stick with there tip into geometry and you don't notice it, one could avoid unwanted transformations.
But it's great to be able to have the hair guides deform correctly now!
Cheers
Thomas
-
Mathaeus
- Posts: 1778
- Joined: 08 Jun 2009, 19:11
- Location: Zagreb, Croatia
Re: Transferring envelope weight to polygon island
Pancho wrote:Yippi-eii-yeah!!!
The only thing I have to figure out is whether it is possible in Modo or LW to identify the root of the hair guide and assign some kind of cluster information to it which loads into SI.
Thomas
Usually, procedurally created geometry has vertices sorted in some recognizable pattern. For example, in Softimage you could use NURBS surface as a morph target for mesh grid, or reverse, if subdivisions of both 'fits'.
'Root' ID is most likely the lowest one in island, or lowest +1. For example, if your strip has 11 subdivisions, and all hairs has the same count of segments, root ID might be 0 ,1, 23, 24, 47,48.... If this order isn't messed up in exporting-importing, there is a chance you can find the root ID, using some simple math, let's say, point ID/count of vertices for polygon island. ... as long as there is no changes in topology (extrude, weld, so on)
I have no idea how does it works in LW/Modo, but I think you'll definitively could try this, 're-mapping' method. It works flawlessly with extrusion from Melena/MT strands.