|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| Distance between Null and Weight Map
|
|
|
I’m hoping someone can help me. I need to get the distance from a nulls position and a weight map, when a null moves it controls the value of the weight map. Get distance between has a input for two vectors, I could plug in a weight map and convert it to a vector but I know it won’t work.
|
|
|
|
I tried my attempt at a bulge by null position effect. Although a it does sorta work, I’m no expert but atleast I’m trying to learn and understand, I hope that counts for something. I hope someone can show me the error in my ways to make this compound/ICE Tree complete ?
| Attachment
|
|
|
|
|
|
Hi , thought I’d throw a Falcon, Sheep, or Owl a bone, as they are quite persistent.
well you are talking about two separate things and mixing them up badly in your tree.
1. There is a ‘bulge’ effect which is a simple push along the normals using a weight map
2. Distance to Object which affects the weight map values
here is a compound that does both. I even use the null to modulate the effect so now you can ‘bulge’ or ‘pinch’ by scaling the null. It also does not affect any existing weights painted so that it is added rather than replaces.
enjoy :)
|
|
|
|
Thank you, I’m plugging in a null into ‘null name’ which has a neutral pose. Everything works but when I scale the null, the null doesn’t control the weight map on the object & there is just a slightly bulge on the part of the weight map.
|
|
|
|
|
are you playing back the timeline whilst scaling the null? if not then you will need to put some keyframes of the scaling in. works fine here. are you wanting the null scale to control the entire weightmap weights ? I wired this up differently than that so the scaling only affects the area that it is influencing. this way you can use more than one null at once…
Author: Tekano
|
| Replied: 19 February 2011 06:51 AM
|
|
|
|
are you playing back the timeline whilst scaling the null? if not then you will need to put some keyframes of the scaling in. works fine here. are you wanting the null scale to control the entire weightmap weights ? I wired this up differently than that so the scaling only affects the area that it is influencing. this way you can use more than one null at once…
I added keyframes and scaled the null, but I didn’t notice a difference. I have one weight map on the object which when I scale I want to effect the weight map, the ability to effect multiply weight maps is a nice option.
When I scale the null using small scalar values the way the ICE Compound currently stands, it snaps between values there is no gradual grow and shrink of the weight map from bulge back to regular zero values, I hope that made sense :)
|
|
|
|
how far away is the null when you are scaling? have you tried increasing the start distance value in the compound? this was just a simple example to get you started, have a look inside the compound and see what is going on and make changes to it however you want your effect to be
|
|
|
how far away is the null when you are scaling?
I’ve tried the null within the weight map and just below the weight map. When I adjust the value in the start distance it just snaps between two values, one value bloating the entire object. A value of zero, bloats the entire object. A value of for example 2.5 bloats the weight map but not as much as I would want, scaling the null doesn’t do anything.
|
|
|
|
I noticed that the weight of the compound was plugged into the add node, but the add node was not plugged into the multiple node of the setdata.tmp, if that was left out intentionally for me to figure out :)
Finally, I’d like to solve with {minimum} and {softmin} nodes is to limit the null scaling. When the null is scaled beyond zero the values go into negative territory. When the null is scaled down to zero it stops at zero and the maximum weight value is reached, instead of it going into negative scalar numbers, do you know what is missing in this compound for this to work?
|
|
|
|
|
yes it is not annotated or thought out very well, am sure there lots of different ways of doing this , this is just how I would attempt this , but where to begin explaining stuff for such an anthropomorphied! :)
I think, Christopher, in order to learn it, that you should try and connect that stray Add node up (replacing the first input port on the multiply ) all its doing is adding (per point) the existing weightmap values to the distance between themselves and the null. This is then Multiplied by the scale of the Null.
You now don’t need the TMP attribute so go ahead and change the set data from TMP and set it directly to the weightmap - this.cls.WeightMapCls.Weight_Map.Weights , ah but now see the tree goes red at the bottom? this is because we took away the the TMP value so just delete the get.tmp and add nodes then connect the weightmap .weights up to the port of the multiply by scalar node. this is more like what you are requesting, I did it this way first but then realized that the null would scale the entire weightmap which imo would be detrimental but hey, who knows the weird of wonderful world of the nerd owl at falconcrest.
Why dont you try and do the scale limiter yourself? you already know that the nulls scale is being fed to a 3d vector to scalar and then multiplied to affect the values. An if and > nodes should do it fine :)
Author: Tekano
|
| Replied: 21 February 2011 06:50 AM
|
|
|
|
|
Attached is a push compound with annotations. This should shed some light on how to work with coordinate spaces and vectors to deform a mesh by pushing it’s points at a simple level.
Because of your requirements, there are multiple inputs feeding into the compound. Values that can be changed by the user are exposed as parameters to the compound. Those which do not change are fixed inside the compound.
I agree much needs to be done to fill the void between what softimage provides and what users can comprehend and work with. Filling that void isn’t a small task.
|
|
|
|
Both compounds are good, but the one mantom create targets the effect I was after precisely, and the helpful comments although not completely understood, does help :) I have a few questions for mantom, the GetDistanceToPosition node is getting the distance from the ObjectPointPosition and the Icon position, I don’t have anything plugged into the Icon position when I plug in a null.kine.global.pos I don’t see the null effecting anything, but the GetDistanceToPosition is trying to compute the distance between two vectors. Rescale node I understand, never hurts to comment :)
|
|
|
FalconCrest 21 February 2011 07:43 PM
Both compounds are good, but the one mantom create targets the effect I was after precisely, and the helpful comments although not completely understood, does help :) I have a few questions for mantom, the GetDistanceToPosition node is getting the distance from the ObjectPointPosition and the Icon position, I don’t have anything plugged into the Icon position when I plug in a null.kine.global.pos I don’t see the null effecting anything, but the GetDistanceToPosition is trying to compute the distance between two vectors. Rescale node I understand, never hurts to comment :)
GetDistanceToPosition is a helper function, so to speak. The icon position is described in global space (null.kine.global.pos), but the object’s point position (Self.PointPosition) is described in the object’s local space. In order to compute the distance between them, the positions must be described in the same coordinate space. Usually I convert the icon position to local space of the object as it’s one conversion vs. doing the opposite for each point on the mesh, but with ICE I think it’s a wash as the tree gets parsed and evaluated either way.
If nothing is plugged into the icon position port, then whatever numerical values are shown in the compound’s PPG will be used for the distance computations.
Here’s a simple script to hook things up.
// (JScript)
// create new scene, then run from script editor.
//
var oNull = ActiveSceneRoot.AddNull();
var oPolygonMesh = ActiveSceneRoot.AddGeometry( "grid", "MeshSurface", "DeformedMesh" );
var oCluster = oPolygonMesh.ActivePrimitive.Geometry.AddCluster( siVertexCluster, "ML_PushWeights" );
var oWeightMap = oCluster.AddProperty( "Weight Map Property", false, "ML_PushWeights" );
var oGridData = XSIFactory.CreateGridData(); oGridData.Data = oWeightMap.Elements.Array; LogMessage( oGridData.RowCount + ", " + oGridData.ColumnCount );
for ( var i = 0; i < oGridData.RowCount; i++ ) {
oGridData.SetCell( 0, i, ( i / oGridData.RowCount ) ); }
oWeightMap.Elements.Array = oGridData.Data;
var oOperators = ApplyOp("ICETree", oPolygonMesh.FullName, siNode, null, null, 0);
var oICETree = oOperators(0);
AddICECompoundNode( "ML_Push", oICETree ); ConnectICENodes(oPolygonMesh.FullName + ".polymsh.ICETree.port1", oPolygonMesh.FullName + ".polymsh.ICETree.ML_Push.Execute"); OpenAttachments(null); SelectObj( oWeightMap.FullName, null, null); AddICENode("GetDataNode", oPolygonMesh.FullName + ".polymsh.ICETree"); SetValue(oPolygonMesh.FullName + ".polymsh.ICETree.SceneReferenceNode.reference", oWeightMap.FullName, null); SetValue(oPolygonMesh.FullName + ".polymsh.ICETree.SceneReferenceNode.reference", oWeightMap.FullName + ".Weights", null); ConnectICENodes( oPolygonMesh.FullName + ".polymsh.ICETree.ML_Push.Weights", oPolygonMesh.FullName + ".polymsh.ICETree.SceneReferenceNode.value" ); ActivateObjectSelTool(null); SetAndToggleSelection("null", null, true); ActivateObjectSelTool(null); OpenAttachments(null); SetMarking("kine.global.pos"); AddICENode("GetDataNode", oPolygonMesh.FullName + ".polymsh.ICETree"); SetValue(oPolygonMesh.FullName + ".polymsh.ICETree.SceneReferenceNode[1].reference", oNull.FullName + ".kine.global.pos", null); ConnectICENodes( oPolygonMesh.FullName + ".polymsh.ICETree.ML_Push.IconPosition", oPolygonMesh.FullName + ".polymsh.ICETree.SceneReferenceNode[1].value");
|
|
|
|