PDA

View Full Version : can i have solid bones in maya?


Levitateme
07-24-2003, 07:55 AM
i was looking at some images of 3ds bones, they are solid. they ahve color to them then also mirai has solid bones as well. is ther a way to have this in maya? i think it owuld be really handy, cuase when i have alot of geometry its hard sometimes to find the wires of the bones.

dwalden74
07-24-2003, 08:08 AM
I agree, that would be a useful feature. Unfortunately itīs not built-in to Maya. However, with some basic MEL, you can pretty much create this. Just loop through every bone in your joint hierarchy and parent a cube under each bone. You can get the length of each joint and assign that to each cubeīs length. You could also parent the cubesīshapes with "parent -r -s", such that when you select the cubes in the viewport, you actually select the joint itself. This is a handy one. Many features from other softwares can be recreated rather easily in Maya with a little MEL knowledge.

:beer:
David

Levitateme
07-24-2003, 08:17 AM
hmmm well i was looking for soemthign automated like a plugin or somethign like that. so when i create the bones there already solid.

wrend
07-24-2003, 11:00 AM
mm, i wrote one of these a while back. was nice too, but i cant find it anywhere....its probably locked up in an archive, i did however find another script during my searches by Adam, doing a similar thing. watch for word wrap, etc :

// makeSolidSkeleton by Adam Martinez
// usage: makeSolidSkeleton
// Select the root joint of a skeleton and type makeSolidSkeleton.
// This script creates a geometric representation of the skeleton
// system, that can be rendered. Uses constrained geometry under a
// group called SolidSkeleton for easy access.


global proc makeSolidJoint(string $currentJoint)
{
string $selection[], $children[], $solidJoint[], $parent[], $parentJoint;
global string $SS_group, $SS_node;
$children = `listRelatives -c $currentJoint`;
for($node in $children)
{

if (`nodeType $node` == "joint")
{
makeSolidJoint($node);
}
}

string $name = $currentJoint + "_SJ";
$parent = `listRelatives -p $currentJoint`;
if (($parent[0] != "")&&($currentJoint != $SS_node))
{
$parentJoint = $parent[0];
$solidJoint = `cone -pivot 0 0 0 -axis 1 0 0 -r 1 -ssw 0 -esw 360 -d 1 -s 4 -nsp 1 -hr 2 -po 1 -n $name`;
catch(`parent $solidJoint $SS_group`);
float $xform1[], $xform2[];
vector $distanceVector;
float $dispScale = `jointDisplayScale -q`;
$xform1 = `xform -q -ws -t $currentJoint`;
$xform2 = `xform -q -ws -t $parentJoint`;
vector $vector1, $vector2;
$vector1 = << ($xform1[0]),($xform1[1]),($xform1[2])>>;
$vector2 = << ($xform2[0]),($xform2[1]),($xform2[2])>>;
float $dist = mag($vector2 - $vector1);
float $dist = $dist/2;
scale -r $dist $dispScale $dispScale $solidJoint;
pointConstraint -weight 1 $parentJoint $solidJoint;
aimConstraint -aim 1 0 0 -u 0 1 0 -wu 0 1 0 -weight 1 $currentJoint $solidJoint;
}

}

global proc makeSolidSkeleton(){

string $selection[], $currentNode;
global string $SS_node;
$selection = `ls -sl`;

global string $SS_group;
$SS_group = `group -empty -name "SolidSkeleton"`;
for($SS_node in $selection)
{
if (`nodeType $SS_node` == "joint")
{
makeSolidJoint($SS_node);
}
}
}

Levitateme
07-24-2003, 10:47 PM
wow wrend

i copied and pasted your script and named it

makeSolidJoint.mel

i typed that in as the command to execute it nothing happend. did i do soemthing wrong? what is that thing about searches by adam?

Levitateme
07-24-2003, 11:29 PM
hi wrend, i got it working sorry for the earlier reply. is there a way to make it so the geometry is not so incredibly heavy? like so each joint has 4 polygons on it total. and can the bones dissapear? so when you rotate the geometry its rotating the joint.

Modulok
07-25-2003, 05:49 AM
Not sure on the solid bone thing, but for selecting bones in a conmplex scene, I use a selction marking menu that picks different selection masks for me. Speeds things up a bunch :thumbsup:

Selection Marking Menu (http://www.thegnomonworkshop.com/tutorials/selections/selections.html)

-Modulok-

Levitateme
07-25-2003, 06:17 AM
what? well im tryign to have solid bones.

Modulok
07-25-2003, 11:12 AM
what? well im tryign to have solid bones.

I'm aware, I'm just saying I don't see a need for solid bones. You stated that "...cuase when i have alot of geometry its hard sometimes to find the wires of the bones" so I thought I would suggest an alternative...

-Modulok-

wrend
07-25-2003, 06:19 PM
yep. id write my own if i were you, its a pretty easy task, a good little project if your just starting out.

as for geom density...having a look, the constructn of them is going from nurbs to poly, w all the history still existing! so, you can go back and tweak the conversn, and the initial creatn nodes to dial the geom down. you should delete these histories in any case! these should probably be instances too.

can the bones dissapear? yep. hide the skeleton root. rotate the geometry bones, and the skeleton bones rotate? yep, see post above about parenting shapes under the same transform...so when you select your solid bones, your selecting the transform for both the skel representations. this would require a mod on that script to kill the constraints, and do the shape parenting.

Levitateme
07-25-2003, 11:27 PM
thanks wrend.

CGTalk Moderation
01-15-2006, 05:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.