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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

skinCluster weights from bifrost

Message 1 of 2
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.




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. # 

# Result: [(1.0,)] # 

# 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:



# Result: [(1.0,)] # 

# 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?

Message 2 of 2
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