import c4d
from c4d import gui
def main():
# create Array
A_Fingers = ["R_Finger", "L_Finger"]
# Puts CC_Base_Body weight tag in a variable
wTag = doc.SearchObject('CC_Base_Body').GetTag(c4d.Tweights)
# Calls "Reset Bind Pose" button in the weight tag
c4d.CallButton(wTag, c4d.ID_CA_WEIGHT_TAG_RESET)
# A loop where the corresponding fingers are reset to 0
for k in A_Fingers:
for i in range(0,5):
doc.SearchObject(str(k) + str(i) + '2').SetAbsRot(c4d.Vector(0,0,0))
# Calls "Set Bind Pose" button in the weight tag
c4d.CallButton(wTag, c4d.ID_CA_WEIGHT_TAG_SET)
# Popup dialog to confirm that the fingers have been reset
gui.MessageDialog('Fingers reset')
# Invert alpha shaders
mat = doc.GetFirstMaterial()
while(mat):
channel = mat[c4d.MATERIAL_ALPHA_SHADER]
if channel:
mat[c4d.MATERIAL_ALPHA_SHADER][c4d.BITMAPSHADER_BLACKPOINT] = 1
mat[c4d.MATERIAL_ALPHA_SHADER][c4d.BITMAPSHADER_WHITEPOINT] = 0
mat = mat.GetNext()
# Popup dialog to confirm alpha shaders are inverted
gui.MessageDialog('Alpha shaders inverted')
# Set specular strength to 0 in the Cornea reflectance channel
refMat = doc.SearchMaterialInc('Cornea')
refLayerCount = refMat.GetReflectionLayerCount()
for i in range(0,refLayerCount):
refLayer = refMat.GetReflectionLayerIndex(i)
if refLayer.GetName() == 'Specular':
refMat[c4d.REFLECTION_LAYER_MAIN_VALUE_SPECULAR + refLayer.GetDataID()] = 0
# Popup dialog to confirm Specular Strength has been set to 0
gui.MessageDialog('Cornea Specular Strength set to 0')
if __name__=='__main__':
main()