Community
Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

skinCluster weights from bifrost

1 REPLY 1
SOLVED
Reply
Message 1 of 2
ilpoldoU8ACM
256 Views, 1 Reply

skinCluster weights from bifrost

Hi! I am outputting some Maya geometry from a bifrost graph and wanted do provide the geo's weights for a skin cluster from the same bifrost graph.

 

bifrost_skin_weights.png

 

I am struggling to make a connection between the bifrost graph's output and the skin cluster. I can connect the compound, but the leaf weight attribute is not reading the right value:

 

 

cmds.connectAttr('prep_geoShape.weightList', 'skinCluster1.weightList')
# Result: Connected prep_geoShape.weightList to skinCluster1.weightList. # 

cmds.getAttr('prep_geoShape.weightList[0].weightList_A')
# Result: [(1.0,)] # 

cmds.getAttr('skinCluster1.weightList[0].weights')
# Result: [(5.263544247e-315,)] # 

 

 

From what I can understand of these fat connections, the compound child attribute name needs to match but I cannot simply create or alias a "weights" attribute on the bifrost graph because that attribute already exists.

Am I supposed to use that weights attribute?

I am able to copy data from one attribute to the next by iterating each entry in the weightsList, and the geometry from the bifrost graph changes only when users change some inputs on the graph (not time dependant).  I am thinking about running a one-off copy script, but I am guessing that performance and stability would still be good or better if  the skinCluster's weight could come directly from the bifrost graph.

 

The other thing I started considering is whether it is necessary to add an extra node that could somehow have an input and output compound that could help dealing with "remapping" the compound attributes:

 

 

cmds.getAttr('weigthsRemap1.inputWeights[0].weightList_A')
# Result: [(1.0,)] # 

cmds.getAttr('weigthsRemap1.outputWeights[0].weights')
# Result: [(1.0,)] # 

cmds.connectAttr('prep_usd_geoShape.weightList', 'weigthsRemap1.inputWeights')
cmds.connectAttr('weigthsRemap1.outputWeights', 'skinCluster1.weightList')

 

Could something like this work? Is there an easy way to set up a node like this that doesn't involve implementing a custom node?

 

Is there a better solution altogether?

1 REPLY 1
Message 2 of 2
ilpoldoU8ACM
in reply to: ilpoldoU8ACM

Somebody pointed out that the issue with my setup was just the datatype of the output. The compound array connection works  if the weights output from the bifrost graph is array<array<dobule>> instead of array<array<float>>.

 

I couldn't find a way to inspect the expected types of the skinCluster node using the Maya cmds API, but it turns out you can simply hover over the connection dots in the node editor and check the tooltip for the expected datatype.

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums