Merged 40338-40364 soc-2011-radish
authorJason Hays <jason_hays22@mymail.eku.edu>
Mon, 19 Sep 2011 15:36:30 +0000 (15:36 +0000)
committerJason Hays <jason_hays22@mymail.eku.edu>
Mon, 19 Sep 2011 15:36:30 +0000 (15:36 +0000)
14 files changed:
1  2 
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/meshlaplacian.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/mesh/editmesh.c
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_scene.c

@@@ -2317,85 -1829,9 +2317,85 @@@ void OBJECT_OT_vertex_group_normalize_a
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
  
-       RNA_def_boolean(ot->srna, "lock_active", TRUE, "Lock Active", "Keep the values of the active group while normalizing others.");
+       RNA_def_boolean(ot->srna, "lock_active", TRUE, "Lock Active", "Keep the values of the active group while normalizing others");
  }
  
 +static int vertex_group_fix_exec(bContext *C, wmOperator *op)
 +{
 +      Object *ob= CTX_data_active_object(C);
 +      Scene *scene= CTX_data_scene(C);
 +      
 +      float distToBe= RNA_float_get(op->ptr, "dist");
 +      float strength= RNA_float_get(op->ptr, "strength");
 +      float cp= RNA_float_get(op->ptr, "accuracy");
 +      ModifierData *md= ob->modifiers.first;
 +
 +      while(md) {
 +              if(md->type == eModifierType_Mirror && (md->mode&eModifierMode_Realtime)) {
 +                      break;
 +              }
 +              md = md->next;
 +      }
 +      
 +      if(md && md->type == eModifierType_Mirror) {
 +              BKE_report(op->reports, RPT_ERROR_INVALID_CONTEXT, "This operator does not support an active mirror modifier");
 +              return OPERATOR_CANCELLED;
 +      }
 +      vgroup_fix(scene, ob, distToBe, strength, cp);
 +      
 +      DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
 +      WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
 +      WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data);
 +      
 +      return OPERATOR_FINISHED;
 +}
 +
 +void OBJECT_OT_vertex_group_fix(wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name= "Fix Vertex Group Deform";
 +      ot->idname= "OBJECT_OT_vertex_group_fix";
 +      ot->description= "Modify the position of selected vertices by changing only their respective groups' weights (this tool may be slow for many vertices).";
 +      
 +      /* api callbacks */
 +      ot->poll= vertex_group_poll;
 +      ot->exec= vertex_group_fix_exec;
 +      
 +      /* flags */
 +      ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 +      RNA_def_float(ot->srna, "dist", 0.0f, -FLT_MAX, FLT_MAX, "Distance", "The distance to move to.", -10.0f, 10.0f);        
 +      RNA_def_float(ot->srna, "strength", 1.f, -2.0f, FLT_MAX, "Strength", "The distance moved can be changed by this multiplier.", -2.0f, 2.0f);
 +      RNA_def_float(ot->srna, "accuracy", 1.0f, 0.05f, FLT_MAX, "Change Sensitivity", "Changes the amount weights are altered with each iteration: lower values are slower.", 0.05f, 1.f);
 +}
 +
 +
 +static int vertex_group_lock_exec(bContext *C, wmOperator *op)
 +{
 +      Object *ob= CTX_data_active_object(C);
 +
 +      int action = RNA_enum_get(op->ptr, "action");
 +
 +      vgroup_lock_all(ob, action);
 +
 +      return OPERATOR_FINISHED;
 +}
 +
 +void OBJECT_OT_vertex_group_lock(wmOperatorType *ot)
 +{
 +      /* identifiers */
 +      ot->name= "Change the Lock On Vertex Groups";
 +      ot->idname= "OBJECT_OT_vertex_group_lock";
 +
 +      /* api callbacks */
 +      ot->poll= vertex_group_poll;
 +      ot->exec= vertex_group_lock_exec;
 +
 +      /* flags */
 +      ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 +
 +      WM_operator_properties_select_all(ot);
 +}
 +
  static int vertex_group_invert_exec(bContext *C, wmOperator *op)
  {
        Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;