rentdanax.blogg.se

Maya python setattr with wildcard
Maya python setattr with wildcard









maya python setattr with wildcard

Select all the spheres, and open script editor, in your script editor type in this small code and execute it. You can use renaming function in maya or do a simple MEL script for it.

maya python setattr with wildcard

Rename it so it look like grape1, grape2, …., grape50 or so. If one surface is inShape of a switcher then the attribute in inTriple will be used.Ĭreate a shading network for grapes, it should be green grapes with subtle variation for ripeness of individual fruit.Ĭreate your grapes model, make it consist of about 50 elongated spheres, with slightly different scaling for each. With the switcher we just simply tell Maya what to use when she is rendering the scene. Which mean if you need to modify other channel on the material node, you do it in a single location. Use MMB to drag the ramp and checker texture next to the surface in the inShape pane, you will see now you have several sphere with 2 color but came from the same material node. If a surface is included in inShape attribute of a triple shading switch and has no attribute connected to inTriple then Maya assume the value is 0 0 0 not the default color you set for the triple shading switch. Since all of the new sphere has not been included in the inShape of the switch node, it will use default color that you set for the triple shading switch.Ĭlick again on the Add surfaces in the switch attributes tab of the switcher node, and now all your new sphere has black color. In modeling viewport if you are in smooth shaded mode with hardware texturing on, you will see one of the sphere will have the default ramp texture, while other will have default checker texture.Ĭreate some more spheres, assign the same material to them. Now MMB drag the ramp texture in your hypershade and drop it into the first inTripple box, and do the same thing with the checker texture. Select the triple shading switch and connect it to color channel of the blinn.Open the attribute editor of the switch (or you can double click it in hypershade), and click Add surfaces in the switch attributes tab.You will see on the left pane ( inShape) your object will be listed (Add surfaces will add all object that share the shading group). So now both are sharing the same materials.Ĭreate a tripleShadingSwitch (color is a triple value), a default ramp texture and a default checker texture. With single shading switch, the output will be a scalar, while other will be a compound value of 2, 3, and 4 respectively.Īs it might be difficult to visualize the usage without seeing it, let’s make a basic example.Ĭreate a shading network for 2 sphere, one with default ramp texture and one with default checker texture.Ĭreate 2 nurbsSphere, and apply a blinn material to them. What makes the different is the output of the node. Maya comes with 3 kind (4 kind in Maya 5.0) switch node, all are located as utility node in Create Bar.It has: One of the most useful things when dealing with a lot of variation in surface color is using a switch node. Once this is done, you can select the Orig node and delete its history, thereby disconnecting the mesh’s dependence on the repair mesh.īy Daniel Harjanto a.k.a misterdi ORIGINAL LINK Use the Mesh->Transfer Attributes dialogue with “UVs” and “Topology” selected to transfer the UVs (ensure same map channels on both meshes is the same) from the repair object to the Orig node of the hierarchy. This will result in the Orig mesh being displayed on top of the final mesh.

maya python setattr with wildcard

Select this and check the “intermediate object” checkbox in the Attribute Editor. You will notice that listed under the shape is an “ShapeOrig” node. Make sure that you are displaying both Shapes and Hidden. Select the target (original) object and graph in Hypergraph Hierarchy. Once this has been achieved, you can safely delete the history on the Original node thereby severing its dependency on the source object, and applying the uv’s before any deformation thereby preventing sliding. There is, however a solution, which is to add them to the Original mesh node which, by default, is hidden. If you use the standard method of selecting the objects and going to Mesh -> Transfer Attributes, then the result is a matching set of uv’s which are tied to the source object, and will be applied after deformation and skinning, meaning they will slide when deformed.











Maya python setattr with wildcard