diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-12 15:01:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-12 15:01:29 +0400 |
commit | a9f6e5438443e6b35db1e22f6c595d31804af9b6 (patch) | |
tree | c196cb64ba0c687bf1ed9f568a710b7ee865b230 /source/blender/makesrna/intern/rna_armature.c | |
parent | 68e27b749ec0ebcde549cf2bc442a17f829c87ee (diff) |
style cleanup: mostly whitespace in rna
Diffstat (limited to 'source/blender/makesrna/intern/rna_armature.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_armature.c | 126 |
1 files changed, 65 insertions, 61 deletions
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index c97a4751135..45887a2264d 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -55,14 +55,14 @@ static void rna_Armature_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), ID *id = ptr->id.data; DAG_id_tag_update(id, 0); - WM_main_add_notifier(NC_GEOM|ND_DATA, id); + WM_main_add_notifier(NC_GEOM | ND_DATA, id); /*WM_main_add_notifier(NC_OBJECT|ND_POSE, NULL); */ } static void rna_Armature_act_bone_set(PointerRNA *ptr, PointerRNA value) { - bArmature *arm = (bArmature*)ptr->data; + bArmature *arm = (bArmature *)ptr->data; if (value.id.data == NULL && value.data == NULL) { arm->act_bone = NULL; @@ -84,7 +84,7 @@ static void rna_Armature_act_bone_set(PointerRNA *ptr, PointerRNA value) static void rna_Armature_act_edit_bone_set(PointerRNA *ptr, PointerRNA value) { - bArmature *arm = (bArmature*)ptr->data; + bArmature *arm = (bArmature *)ptr->data; if (value.id.data == NULL && value.data == NULL) { arm->act_edbone = NULL; @@ -103,7 +103,7 @@ static void rna_Armature_act_edit_bone_set(PointerRNA *ptr, PointerRNA value) EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, const char *name) { if (arm->edbo == NULL) { - BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant add an editbone", arm->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant add an editbone", arm->id.name + 2); return NULL; } return ED_armature_edit_bone_add(arm, name); @@ -112,12 +112,12 @@ EditBone *rna_Armature_edit_bone_new(bArmature *arm, ReportList *reports, const void rna_Armature_edit_bone_remove(bArmature *arm, ReportList *reports, EditBone *ebone) { if (arm->edbo == NULL) { - BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant remove an editbone", arm->id.name+2); + BKE_reportf(reports, RPT_ERROR, "Armature '%s' not in editmode, cant remove an editbone", arm->id.name + 2); return; } if (BLI_findindex(arm->edbo, ebone) == -1) { - BKE_reportf(reports, RPT_ERROR, "Armature '%s' doesn't contain bone '%s'", arm->id.name+2, ebone->name); + BKE_reportf(reports, RPT_ERROR, "Armature '%s' doesn't contain bone '%s'", arm->id.name + 2, ebone->name); return; } @@ -135,19 +135,19 @@ static void rna_Armature_update_layers(Main *bmain, Scene *UNUSED(scene), Pointe if (ob->data == arm && ob->pose) ob->pose->proxy_layer = arm->layer; - WM_main_add_notifier(NC_GEOM|ND_DATA, arm); + WM_main_add_notifier(NC_GEOM | ND_DATA, arm); } static void rna_Armature_redraw_data(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { ID *id = ptr->id.data; - WM_main_add_notifier(NC_GEOM|ND_DATA, id); + WM_main_add_notifier(NC_GEOM | ND_DATA, id); } static char *rna_Bone_path(PointerRNA *ptr) { - Bone *bone = (Bone*)ptr->data; + Bone *bone = (Bone *)ptr->data; /* special exception for trying to get the path where ID-block is Object * - this will be assumed to be from a Pose Bone... @@ -192,60 +192,60 @@ static void rna_bone_layer_set(int *layer, const int *values) int i, tot = 0; /* ensure we always have some layer selected */ - for (i = 0; i<32; i++) + for (i = 0; i < 32; i++) if (values[i]) tot++; if (tot == 0) return; - for (i = 0; i<32; i++) { - if (values[i]) *layer |= (1<<i); - else *layer &= ~(1<<i); + for (i = 0; i < 32; i++) { + if (values[i]) *layer |= (1 << i); + else *layer &= ~(1 << i); } } static void rna_Bone_layer_set(PointerRNA *ptr, const int *values) { - Bone *bone = (Bone*)ptr->data; + Bone *bone = (Bone *)ptr->data; rna_bone_layer_set(&bone->layer, values); } static void rna_Armature_layer_set(PointerRNA *ptr, const int *values) { - bArmature *arm = (bArmature*)ptr->data; + bArmature *arm = (bArmature *)ptr->data; int i, tot = 0; /* ensure we always have some layer selected */ - for (i = 0; i<32; i++) + for (i = 0; i < 32; i++) if (values[i]) tot++; if (tot == 0) return; - for (i = 0; i<32; i++) { - if (values[i]) arm->layer |= (1<<i); - else arm->layer &= ~(1<<i); + for (i = 0; i < 32; i++) { + if (values[i]) arm->layer |= (1 << i); + else arm->layer &= ~(1 << i); } } /* XXX depreceated.... old armature only animviz */ static void rna_Armature_ghost_start_frame_set(PointerRNA *ptr, int value) { - bArmature *data = (bArmature*)ptr->data; - CLAMP(value, 1, (int)(MAXFRAMEF/2)); + bArmature *data = (bArmature *)ptr->data; + CLAMP(value, 1, (int)(MAXFRAMEF / 2)); data->ghostsf = value; if (data->ghostsf >= data->ghostef) { - data->ghostef = MIN2(data->ghostsf, (int)(MAXFRAMEF/2)); + data->ghostef = MIN2(data->ghostsf, (int)(MAXFRAMEF / 2)); } } static void rna_Armature_ghost_end_frame_set(PointerRNA *ptr, int value) { - bArmature *data = (bArmature*)ptr->data; - CLAMP(value, 1, (int)(MAXFRAMEF/2)); + bArmature *data = (bArmature *)ptr->data; + CLAMP(value, 1, (int)(MAXFRAMEF / 2)); data->ghostef = value; if (data->ghostsf >= data->ghostef) { @@ -256,8 +256,8 @@ static void rna_Armature_ghost_end_frame_set(PointerRNA *ptr, int value) static void rna_EditBone_name_set(PointerRNA *ptr, const char *value) { - bArmature *arm = (bArmature*)ptr->id.data; - EditBone *ebone = (EditBone*)ptr->data; + bArmature *arm = (bArmature *)ptr->id.data; + EditBone *ebone = (EditBone *)ptr->data; char oldname[sizeof(ebone->name)], newname[sizeof(ebone->name)]; /* need to be on the stack */ @@ -269,8 +269,8 @@ static void rna_EditBone_name_set(PointerRNA *ptr, const char *value) static void rna_Bone_name_set(PointerRNA *ptr, const char *value) { - bArmature *arm = (bArmature*)ptr->id.data; - Bone *bone = (Bone*)ptr->data; + bArmature *arm = (bArmature *)ptr->id.data; + Bone *bone = (Bone *)ptr->data; char oldname[sizeof(bone->name)], newname[sizeof(bone->name)]; /* need to be on the stack */ @@ -282,7 +282,7 @@ static void rna_Bone_name_set(PointerRNA *ptr, const char *value) static void rna_EditBone_layer_set(PointerRNA *ptr, const int values[]) { - EditBone *data = (EditBone*)(ptr->data); + EditBone *data = (EditBone *)(ptr->data); rna_bone_layer_set(&data->layer, values); } @@ -304,7 +304,7 @@ static void rna_EditBone_connected_check(EditBone *ebone) static void rna_EditBone_connected_set(PointerRNA *ptr, int value) { - EditBone *ebone = (EditBone*)(ptr->data); + EditBone *ebone = (EditBone *)(ptr->data); if (value) ebone->flag |= BONE_CONNECTED; else ebone->flag &= ~BONE_CONNECTED; @@ -314,14 +314,14 @@ static void rna_EditBone_connected_set(PointerRNA *ptr, int value) static PointerRNA rna_EditBone_parent_get(PointerRNA *ptr) { - EditBone *data = (EditBone*)(ptr->data); + EditBone *data = (EditBone *)(ptr->data); return rna_pointer_inherit_refine(ptr, &RNA_EditBone, data->parent); } static void rna_EditBone_parent_set(PointerRNA *ptr, PointerRNA value) { - EditBone *ebone = (EditBone*)(ptr->data); - EditBone *pbone, *parbone = (EditBone*)value.data; + EditBone *ebone = (EditBone *)(ptr->data); + EditBone *pbone, *parbone = (EditBone *)value.data; if (parbone == NULL) { if (ebone->parent && !(ebone->parent->flag & BONE_ROOTSEL)) @@ -350,9 +350,9 @@ static void rna_EditBone_parent_set(PointerRNA *ptr, PointerRNA value) static void rna_EditBone_matrix_get(PointerRNA *ptr, float *values) { - EditBone *ebone = (EditBone*)(ptr->data); + EditBone *ebone = (EditBone *)(ptr->data); - float delta[3], tmat[3][3], mat[4][4]; + float delta[3], tmat[3][3], mat[4][4]; /* Find the current bone matrix */ sub_v3_v3v3(delta, ebone->tail, ebone->head); @@ -365,8 +365,8 @@ static void rna_EditBone_matrix_get(PointerRNA *ptr, float *values) static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - bArmature *arm = (bArmature*)ptr->id.data; - EditBone *ebone = (EditBone*)ptr->data; + bArmature *arm = (bArmature *)ptr->id.data; + EditBone *ebone = (EditBone *)ptr->data; EditBone *child, *eboflip; /* update our parent */ @@ -394,7 +394,7 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po /* update our children if necessary */ for (child = arm->edbo->first; child; child = child->next) if (child->parent == eboflip && (child->flag & BONE_CONNECTED)) - copy_v3_v3 (child->head, eboflip->tail); + copy_v3_v3(child->head, eboflip->tail); } } @@ -404,19 +404,19 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po static void rna_Armature_bones_next(CollectionPropertyIterator *iter) { ListBaseIterator *internal = iter->internal; - Bone *bone = (Bone*)internal->link; + Bone *bone = (Bone *)internal->link; if (bone->childbase.first) - internal->link = (Link*)bone->childbase.first; + internal->link = (Link *)bone->childbase.first; else if (bone->next) - internal->link = (Link*)bone->next; + internal->link = (Link *)bone->next; else { internal->link = NULL; do { bone = bone->parent; if (bone && bone->next) { - internal->link = (Link*)bone->next; + internal->link = (Link *)bone->next; break; } } while (bone); @@ -504,7 +504,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); /* Number values */ - /* envelope deform settings */ + /* envelope deform settings */ prop = RNA_def_property(srna, "envelope_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_range(prop, 0.0f, 1000.0f); @@ -521,7 +521,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) if (editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); else RNA_def_property_update(prop, 0, "rna_Armature_update_data"); RNA_def_property_float_sdna(prop, NULL, "rad_head"); - /* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */ + /* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */ /*RNA_def_property_range(prop, 0, 1000); */ RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Envelope Head Radius", "Radius of head of bone (for Envelope deform only)"); @@ -530,12 +530,12 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) if (editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); else RNA_def_property_update(prop, 0, "rna_Armature_update_data"); RNA_def_property_float_sdna(prop, NULL, "rad_tail"); - /* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */ + /* XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); */ /*RNA_def_property_range(prop, 0, 1000); */ RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Envelope Tail Radius", "Radius of tail of bone (for Envelope deform only)"); - /* b-bones deform settings */ + /* b-bones deform settings */ prop = RNA_def_property(srna, "bbone_segments", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "segments"); RNA_def_property_range(prop, 1, 32); @@ -580,14 +580,14 @@ static void rna_def_bone(BlenderRNA *brna) RNA_def_struct_idprops_func(srna, "rna_Bone_idprops"); /* pointers/collections */ - /* parent (pointer) */ + /* parent (pointer) */ prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Bone"); RNA_def_property_pointer_sdna(prop, NULL, "parent"); RNA_def_property_ui_text(prop, "Parent", "Parent bone (in same Armature)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - /* children (collection) */ + /* children (collection) */ prop = RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "childbase", NULL); RNA_def_property_struct_type(prop, "Bone"); @@ -595,8 +595,8 @@ static void rna_def_bone(BlenderRNA *brna) rna_def_bone_common(srna, 0); - /* XXX should we define this in PoseChannel wrapping code instead? - * But PoseChannels directly get some of their flags from here... */ + /* XXX should we define this in PoseChannel wrapping code instead? + * But PoseChannels directly get some of their flags from here... */ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_P); RNA_def_property_ui_text(prop, "Hide", @@ -745,7 +745,7 @@ static void rna_def_edit_bone(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_THICK_WRAP); /* no reference to original data */ RNA_def_property_ui_text(prop, "Editbone Matrix", "Read-only matrix calculated from the roll (armature space)"); - /* TODO - this could be made writable also */ + /* TODO - this could be made writable also */ RNA_def_property_float_funcs(prop, "rna_EditBone_matrix_get", NULL, NULL); RNA_api_armature_edit_bone(srna); @@ -822,7 +822,7 @@ static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Remove an existing bone from the armature"); /* target to remove*/ parm = RNA_def_pointer(func, "bone", "EditBone", "", "EditBone to remove"); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); + RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); } static void rna_def_armature(BlenderRNA *brna) @@ -837,21 +837,25 @@ static void rna_def_armature(BlenderRNA *brna) {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", "Display bones as extruded spheres, showing deformation influence volume"}, {ARM_WIRE, "WIRE", 0, "Wire", "Display bones as thin wires, showing subdivision and B-Splines"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_vdeformer[] = { {ARM_VDEF_BLENDER, "BLENDER", 0, "Blender", "Use Blender's armature vertex deformation"}, {ARM_VDEF_BGE_CPU, "BGE_CPU", 0, "BGE", "Use vertex deformation code optimized for the BGE"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static EnumPropertyItem prop_ghost_type_items[] = { {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Frame", "Display Ghosts of poses within a fixed number of frames around the current frame"}, {ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Display Ghosts of poses within specified range"}, {ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Display Ghosts of poses on Keyframes"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; static const EnumPropertyItem prop_pose_position_items[] = { {0, "POSE", 0, "Pose Position", "Show armature in posed state"}, {ARM_RESTPOS, "REST", 0, "Rest Position", "Show Armature in binding pose state (no posing possible)"}, - {0, NULL, 0, NULL, NULL}}; + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "Armature", "ID"); RNA_def_struct_ui_text(srna, "Armature", @@ -908,16 +912,16 @@ static void rna_def_armature(BlenderRNA *brna) /* XXX depreceated ....... old animviz for armatures only */ /* Boolean values */ - /* layer */ + /* layer */ prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER); RNA_def_property_boolean_sdna(prop, NULL, "layer", 1); RNA_def_property_array(prop, 32); RNA_def_property_ui_text(prop, "Visible Layers", "Armature layer visibility"); RNA_def_property_boolean_funcs(prop, NULL, "rna_Armature_layer_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Armature_update_layers"); + RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Armature_update_layers"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); - /* layer protection */ + /* layer protection */ prop = RNA_def_property(srna, "layers_protected", PROP_BOOLEAN, PROP_LAYER); RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1); RNA_def_property_array(prop, 32); @@ -926,7 +930,7 @@ static void rna_def_armature(BlenderRNA *brna) "on file reload and undo"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); - /* flag */ + /* flag */ prop = RNA_def_property(srna, "show_axes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWAXES); RNA_def_property_ui_text(prop, "Draw Axes", "Draw bone axes"); @@ -976,7 +980,7 @@ static void rna_def_armature(BlenderRNA *brna) /* Number fields */ /* XXX depreceated ....... old animviz for armatures only */ - /* ghost/onionskining settings */ + /* ghost/onionskining settings */ prop = RNA_def_property(srna, "ghost_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ghostep"); RNA_def_property_range(prop, 0, 30); |