If not selObjsList: assert 'No object is selected!' # Connect the mia_material shader to the shading groupĬmds.connectAttr(dome_mia_shader_name+'.message', dome_mia_shader_group_name+'.surfaceShader', f=True)Ĭmds.connectAttr(dome_mia_shader_name+'.message', dome_mia_shader_group_name+'.miPhotonShader', f=True)Ĭmds.connectAttr(dome_mia_shader_name+'.message', dome_mia_shader_group_name+'.miShadowShader', f=True)Ĭmds.connectAttr(dome_mia_shader_name+'.message', dome_mia_shader_group_name+'.miMaterialShader', f=True) # Set the mia_material to be a matte materialĬmds.setAttr(dome_mia_shader_name+".diffuse", 0.5, 0.5, 0.5, type="double3")Ĭmds.setAttr(dome_mia_shader_name+".diffuse_roughness", 0)Ĭmds.setAttr(dome_mia_shader_name+".diffuse_weight", 1)Ĭmds.setAttr(dome_mia_shader_name+".refl_color", 1, 1, 1, type="double3")Ĭmds.setAttr(dome_mia_shader_name+".reflectivity", 0) Print("Applying the "+dome_mia_shader_name+" surface material to:")Ĭmds.hyperShade(assign=dome_mia_shader_group_name) #Apply the shading group to the selected geometry SelObjsDuplicateMaterials = cmds.duplicate(un=1)ĭupliMater = cmds.rename(item, "%s_duplicate" % (item))ĭuplicateShading = ts(r=1, nss=1, em=1, n="%s_SG" % item)Ĭmds.connectAttr("%s.outColor" % item, "%s.surfaceShader" % duplicateShading, f=1)Įlif cmds.nodeType(item) = "RedshiftDisplacement":ĬonInfo = nnectionInfo("%s.displacementShader" % duplicateShading, sfd=1)Ĭmds.connectAttr("%s.out" % item, "%s.displacementShader" % duplicateShading, f=1)Įlif cmds.nodeType(item) = "displacementShader":Ĭmds.connectAttr("%s.displacement" % item, "%s.displacementShader" % duplicateShading, f=1)ĭef setupDomeMatteMaterial(applyToMeshName):ĭomeShaderName = 'dome_crossbounce_matte_material'ĭome_mia_shader_group_name = ts( renderable=True, noSurfaceShader=True, empty=True, name=domeShaderName+'SG' )ĭome_mia_shader_name = cmds.shadingNode( 'mia_material_x_passes', n=domeShaderName, asShader=True) #probably the better idea then to let them move around the vertecies
![maya python setattr of multiple objects maya python setattr of multiple objects](https://i0.wp.com/www.john-player.com/wp-content/uploads/2019/02/Screenshot-2019-02-28-at-14.03.48.png)
#self.m_height = 100#then we could just calcualte width and height from base w/h and multiple by scale #self.m_width = 100#we could instead use scale and just let them scale instead of drag vertex #self.m_scale = (1, 1, 0) #we shouldn't really work with scale
#Maya python setattr of multiple objects update
#these will need to be actual data, and update as you move the object in the world Light_edf + ".exitance", attributes, attributes, attributes, type="double3"Ĭmds.connectAttr(light_edf + ".outColor", light_material + ".EDF_front_color", f=True)Ĭmds.connectAttr(light_surface_shader + ".outColor", light_material + ".surface_shader_front_color", f=True) Light_edf = ms_commands.create_shading_node("diffuse_edf", area_light + "_edf") Light_surface_shader = ms_commands.create_shading_node("constant_surface_shader", area_light + "_surface_shader")Ĭmds.setAttr(light_surface_shader + ".alpha_multiplier", 0, 0, 0, type="double3") Light_material = cmds.createNode("ms_appleseed_material", n=area_light + "_material")Ĭmds.setAttr(light_material + ".enable_back_material", 0)Ĭmds.setAttr(light_material + ".duplicate_front_attributes_on_back", 0) # create and initialise material for object
![maya python setattr of multiple objects maya python setattr of multiple objects](https://i.vimeocdn.com/video/124609094_1280x720.jpg)
Def convert_area_light(area_light, attributes):