Paint weights, see result in several poses?

Issues concerning rigging & Face Robot...
User avatar
rray
Moderator
Posts: 1570
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany

Paint weights, see result in several poses?

Post by rray » 06 Oct 2016, 18:50

Is there a way to set up a scene so I can weight paint on a model and see the results in different viewports, using a different pose in each?

I though a live GATOR operator on another model that's differently posed might work, but don't seem to be able to set something like this up, GATOR always copies the original bone assignment.

TY for hints
"as a maya discussion grows longer, the probability of a suggestion involving deleting the preferences approaches one"

softimage resources section (formerly known as rray.de/xsi) updated May 30 2018

User avatar
Mathaeus
Posts: 1723
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia

Re: Paint weights, see result in several poses?

Post by Mathaeus » 06 Oct 2016, 21:15

I've used setup that match the definition (if I understood correctly) for sort of crowds, downloadable scene is here. Basically it's ICE envelope on cloned mesh, where original has SI envelope muted, with all weights already applied. So, each clone takes the weights from original, while ICE envelope takes the particular array of transforms.
Don't know how this is feasible for interactive painting, anyway.

P.S. Also, order of deformer members in possible (different) groups should match - I've used modulo shift from point clouds, where matching is granted. In case of different groups, order should be matched by some another way.
The renderer "turtle" used by this scene, is not currently available. The "turtle" renderer will be used instead.

User avatar
rray
Moderator
Posts: 1570
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany

Re: Paint weights, see result in several poses?

Post by rray » 06 Oct 2016, 21:44

Thanks for your relpy. Clones give me an idea I could use a "real" clone's copyOp to copy the weights instead of GATOR. Then an ICE envelope on top.

I'll try to write a script that makes a new model with a new bone hierarchy and the new clone that takes the weights from the master.
"as a maya discussion grows longer, the probability of a suggestion involving deleting the preferences approaches one"

softimage resources section (formerly known as rray.de/xsi) updated May 30 2018

User avatar
rray
Moderator
Posts: 1570
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany

Re: Paint weights, see result in several poses?

Post by rray » 07 Oct 2016, 01:57

This worked fine. I can now isolate views on the differently posed models, paint weights on the master and see immediately what effect it has on the different poses. Even modeling/changing topology works. nice workflow :)
Thanks for your hints.

Code: Select all

run()
function run()
{
	sel0 = selection(0);
	if(!sel0 || sel0.Type == "#model" || sel0.Model.Name == "Scene_Root") {
		logmessage("Error: mesh must be selected and under a model", siError);
		return;
	}
		
	SelectDeformersFromEnvelope(null);
	deformers = selection;
	
	if(deformers(0).Model.Name != sel0.Model.Name) {
		logmessage("Error: bones must be under same model as the mesh", siError);
		return;
	}

	model2 = Duplicate("B:"+sel0.Model)(0);
	model2.Name = sel0.Name + "_reference_pose_1";
	
	SelectObj(model2 + "." + sel0.Name);

	tmp = selection(0);
	tmp.Name = "delete_me_later_pls";
	tmpParent = selection(0).Parent;
	
	SelectDeformersFromEnvelope(null);		
	CreateGroupFromObjects("ICE_Bones");
		
	iceTree = Application.ApplyOp("ICETree", sel0, "", "", "", 0)(0);
	iceTree.Name = "ICESavePointPositions";

	setDataNode = AddICECompoundNode("Set Data", iceTree);
	SetValue(setDataNode+".Reference", "self.SavedPointPosition");
	
	getDataNode = AddICENode( "GetDataNode", iceTree);
	SetValue(getDataNode+".Reference", "self.PointPosition");

	ConnectICENodes(setDataNode+".Value", getDataNode+".Value");
	ConnectICENodes(iceTree+".port1", setDataNode+".Execute");

	var clone = Clone(sel0, null, 1, 1, 0, 0, 1, 0, 1, null, null, null, null, null, null, null, null, null, null)(0);
	iceTree = Application.ApplyOp("ICETree", clone, "", "", "", 0)(0);
	iceTree.Name = "ICEMoveToBasePose";

	setDataNode = AddICECompoundNode("Set Data", iceTree);
	SetValue(setDataNode+".Reference", "self.PointPosition");

	getDataNode = AddICENode( "GetDataNode", iceTree);
	SetValue(getDataNode+".Reference", sel0+".SavedPointPosition");

	var switchContextNode = AddICENode("ICENodes\\SwitchContextNode", iceTree);

	ConnectICENodes(switchContextNode+".Value", getDataNode+".Value");
	ConnectICENodes(setDataNode+".Value", switchContextNode+".Result");
	ConnectICENodes(iceTree+".port1", setDataNode+".Execute");

	iceTree = Application.ApplyOp("ICETree", clone, "", "", "", siConstructionModeAnimation)(0);
	iceTree.Name = "ICEEnvelope";
	
	deformerNode = AddICECompoundNode("Dual Quaternion Deformation", iceTree);	
	
	ConnectICENodes(iceTree+".port1", deformerNode+".Execute");
	SetValue(deformerNode+".Deformer_Group_Reference", "this_model.ICE_Bones", null);
	SetValue(deformerNode+".Deformation_Method", 0, null);

	ParentObj(tmpParent, clone);
	
	clone.Name = sel0.Name;
	
	DeleteObj(tmp);
};
"as a maya discussion grows longer, the probability of a suggestion involving deleting the preferences approaches one"

softimage resources section (formerly known as rray.de/xsi) updated May 30 2018