Share enum types with rna and small bugfix because Ton needs to make keymodifier bitflag work.
This commit is contained in:
@@ -764,15 +764,15 @@ void transformEvent(TransInfo *t, wmEvent *event)
|
||||
}
|
||||
break;
|
||||
case OKEY:
|
||||
if (t->flag & T_PROP_EDIT && event->keymodifier == KM_SHIFT) {
|
||||
t->scene->prop_mode = (t->scene->prop_mode+1)%6;
|
||||
if (t->flag & T_PROP_EDIT && event->shift) {
|
||||
t->prop_mode = (t->prop_mode + 1) % 6;
|
||||
calculatePropRatio(t);
|
||||
t->redraw= 1;
|
||||
t->redraw = 1;
|
||||
}
|
||||
break;
|
||||
case PADPLUSKEY:
|
||||
if(event->keymodifier & KM_ALT && t->flag & T_PROP_EDIT) {
|
||||
t->prop_size*= 1.1f;
|
||||
if(event->alt && t->flag & T_PROP_EDIT) {
|
||||
t->prop_size *= 1.1f;
|
||||
calculatePropRatio(t);
|
||||
}
|
||||
t->redraw= 1;
|
||||
@@ -790,7 +790,7 @@ void transformEvent(TransInfo *t, wmEvent *event)
|
||||
t->redraw= 1;
|
||||
break;
|
||||
case PADMINUS:
|
||||
if(event->keymodifier & KM_ALT && t->flag & T_PROP_EDIT) {
|
||||
if(event->alt && t->flag & T_PROP_EDIT) {
|
||||
t->prop_size*= 0.90909090f;
|
||||
calculatePropRatio(t);
|
||||
}
|
||||
@@ -974,7 +974,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
|
||||
if (RNA_struct_find_property(op->ptr, "proportional"))
|
||||
{
|
||||
RNA_enum_set(op->ptr, "proportional", proportional);
|
||||
RNA_enum_set(op->ptr, "proportional_mode", t->prop_mode);
|
||||
RNA_enum_set(op->ptr, "proportional_editing_falloff", t->prop_mode);
|
||||
RNA_float_set(op->ptr, "proportional_size", t->prop_size);
|
||||
}
|
||||
|
||||
|
||||
@@ -810,9 +810,9 @@ void initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
|
||||
t->prop_size = sce->toolsettings->proportional_size;
|
||||
}
|
||||
|
||||
if (op && RNA_struct_find_property(op->ptr, "proportional_falloff") && RNA_property_is_set(op->ptr, "proportional_falloff"))
|
||||
if (op && RNA_struct_find_property(op->ptr, "proportional_editing_falloff") && RNA_property_is_set(op->ptr, "proportional_editing_falloff"))
|
||||
{
|
||||
t->prop_mode = RNA_enum_get(op->ptr, "proportional_falloff");
|
||||
t->prop_mode = RNA_enum_get(op->ptr, "proportional_editing_falloff");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "RNA_access.h"
|
||||
#include "RNA_define.h"
|
||||
#include "RNA_enum_types.h"
|
||||
|
||||
#include "BLI_arithb.h"
|
||||
|
||||
@@ -250,7 +251,7 @@ static int transform_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
void Properties_Proportional(struct wmOperatorType *ot)
|
||||
{
|
||||
RNA_def_enum(ot->srna, "proportional", proportional_mode_types, 0, "Proportional Edition", "");
|
||||
RNA_def_enum(ot->srna, "proportional_falloff", proportional_falloff_types, 0, "Proportional Falloff", "");
|
||||
RNA_def_enum(ot->srna, "proportional_editing_falloff", prop_mode_items, 0, "Proportional Editing Falloff", "Falloff type for proportional editing mode.");
|
||||
RNA_def_float(ot->srna, "proportional_size", 1, 0, FLT_MAX, "Proportional Size", "", 0, 100);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user