llorens
I quickly coded that up, so I haven't done any extensive testing on that. Save your scene before using it.
Run that part of the script to save and disconnect all of the connections (you can specify more node types in the lists):
import pymel.core as pm
""" Save and disconnect all of the specified node type connections """
ziva_node_types = ["zFiber", "zRestShape", "zTissue"] # Specify Ziva nodes that you want to get connections from
non_ziva_node_types = ["remapValue"] # Specify Non Ziva nodes
connection_list = []
for ziva_node in pm.ls(type=ziva_node_types):
incoming_connections = ziva_node.inputs(s=True, p=True, c=True, type=non_ziva_node_types)
if not incoming_connections:
continue
for connection in incoming_connections:
ziva_node_input = connection[0].name()
non_ziva_node_output = connection[1].name()
connection_list.append([non_ziva_node_output, ziva_node_input])
print "Disconnecting {} // {}".format(non_ziva_node_output, ziva_node_input)
pm.disconnectAttr(non_ziva_node_output, ziva_node_input)
And run this after rebuilding the rig with zBuilder:
""" Reconnect all of the previously saved connections """
for non_ziva_node_output, ziva_node_input in connection_list:
print "Reconnecting {} >> {}".format(non_ziva_node_output, ziva_node_input)
pm.connectAttr(non_ziva_node_output, ziva_node_input)