Autoskinning:

-- added Matt Ebb's menu suggestion
-- Maybe it so the 'empty'/'name' option is disabled for bones that
   are of type 'Unskinnable'.
This commit is contained in:
Chris Want
2003-05-06 02:32:56 +00:00
parent 853d3c711a
commit a9193a88ca

View File

@@ -2658,12 +2658,14 @@ int bone_looper(Object *ob, Bone *bone, void *data,
int add_defgroup_unique_bone(Object *ob, Bone *bone, void *data) { int add_defgroup_unique_bone(Object *ob, Bone *bone, void *data) {
/* This group creates a vertex group to ob that has the /* This group creates a vertex group to ob that has the
* same name as bone. Is such a vertex group aleady exist * same name as bone (provided the bone is skinnable).
* the routine exits. * If such a vertex group aleady exist the routine exits.
*/ */
if (!get_named_vertexgroup(ob,bone->name)) { if ( bone_skinnable(ob, bone, NULL) ) {
add_defgroup_name(ob, bone->name); if (!get_named_vertexgroup(ob,bone->name)) {
return 1; add_defgroup_name(ob, bone->name);
return 1;
}
} }
return 0; return 0;
} }
@@ -2925,8 +2927,10 @@ void create_vgroups_from_armature(Object *ob, Object *par)
/* Prompt the user on whether/how they want the vertex groups /* Prompt the user on whether/how they want the vertex groups
* added to the child mesh */ * added to the child mesh */
mode= pupmenu("Vertex Groups from Bones? %t|No Thanks %x1|Empty %x2|" mode= pupmenu("Create Vertex Groups? %t|"
"Closest Bone %x3"); "Don't Create Groups %x1|"
"Name Groups %x2|"
"Create From Closest Bones %x3");
switch (mode){ switch (mode){
case 2: case 2:
/* Traverse the bone list, trying to create empty vertex /* Traverse the bone list, trying to create empty vertex