global proc prepareMeshForEngine() { string $sel[] = `ls -sl -tr -dag`; if (`size($sel)` <= 0) error("You must select at least one object."); for ($obj in $sel) { string $relatives[] = `listRelatives -s $obj`; int $isMesh = false; // go through the transform's relatives, and see if any of them are // of type "mesh" for ($relative in $relatives) { if (`nodeType $relative` == "mesh") { $isMesh = true; break; // we don't care about the others } } // if we found a mesh relative, continue processing. Otherwise ignore // this object. if ($isMesh) { // use the real freeze transform command, as it avoids warnings makeIdentity -apply true $obj; polyNormalPerVertex -ufn true $obj; // unlock the normals polySoftEdge -angle 90 $obj; // set the normal angle to 90 select -cl; } else warning($obj + " is not a mesh."); } }
Nope. The relatives are any nodes that are the children of the given node. In this case, the child of the transform node, is a shape node. We then go through each shape node, and make sure it's a mesh, not a nurbsSurface, or anything like that. (See that I added a "-s" to the listRelatives command above. This states we're only interested in shape relatives, so the list is smaller and therefore faster to execute)I am assuming going through an objects "relatives" would be for an object that is combined?
A DAG is a graph that is exactly what you said. Directed, and acyclic. Directed, meaning that the connections have a single source, and destination. And acyclic, meaning that you cannot create a loop between connections.I am also kind of fuzzy about Directed Acyclic Graphs (DAG).
It's a bit confusing, as there's a difference between parents, children, and connections. My suggestion would be for you to grab an object, display it's input and output connections, chose a node to start at, and try to traverse the tree to get to another. Try using the following:... it is formed by a collection of vertices and directed edges, where each edge connects one vertex to another, such that there is no way to start at some vertex v and follow a sequence of edges that eventually loops back to v again.
We actually have one already. https://simplymaya.com/forum/forumdisplay.php?f=32You know! This gets me thinking about the possibility of having a Mel scripting thread or forum section. I wonder if there would be interest in that?
Thanks for the recommendation!I volunteer NextDesign as the moderator
What you need to do is place it in a file called prepareMeshForEngine.mel, and place it into the scripts directory. This will make Maya load the code when it starts up. However, this is just the definition, and nothing is calling it. What you need to add to your shelf is "prepareMeshForEngine();" (without quotes) as this will call the code.EDIT: Maybe I'm doing something wrong, but it isn't working for me? Copied in to the Script Editor window, then selected all, and dragged to shelf with middle mouse button
How would I go about sending it around to people? Would I just have to tell them to do the middle mouse drag from script editor thing, or is there a way I can put it in to a file so they can just drop it in to a folder?
The last studio I worked for was Arc Productions (formerly Starz Animation). I'm currently looking for work starting in May.Where do you work, ND? It's all Torontonians here...
Cool. I wish I could take a look at the link, but I don't have a Facebook account. I've done my fair share of racing stuff. My first position was working on the intro to Need for Speed: Pro Street. My uncle also does a lot of car and bike camera work for movies. (And races on the side )My work is overseas, boss lives in Aus, everyone else is spread out all over the place. I think the lead road car guy lives in New Brunswick, or some other redneck place up here :p
https://www.facebook.com/groups/216134590902/