changed extrude, rip and duplicate to disable proportional editing however this gives a different problem now.
Commented in transform.c
// XXX If modal, save settings back in scene
this changes disables the option whenever the macro used used.
/* mesh_ops.c */
void ED_operatortypes_mesh(void);
+void ED_operatormacros_mesh(void);
void ED_keymap_mesh(struct wmKeyConfig *keyconf);
/* object_edit.c */
void ED_operatortypes_object(void);
+void ED_operatormacros_object(void);
void ED_keymap_object(struct wmKeyConfig *keyconf);
/* send your own notifier for select! */
void ED_operatortypes_mesh(void)
{
- wmOperatorType *ot;
-
WM_operatortype_append(MESH_OT_select_all_toggle);
WM_operatortype_append(MESH_OT_select_more);
WM_operatortype_append(MESH_OT_select_less);
WM_operatortype_append(MESH_OT_edgering_select);
WM_operatortype_append(MESH_OT_loopcut);
+}
- /* macros */
+void ED_operatormacros_mesh(void)
+{
+ wmOperatorType *ot;
+ wmOperatorTypeMacro *otmacro;
/*combining operators with invoke and exec portions doesn't work yet.
ot= WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
WM_operatortype_macro_define(ot, "MESH_OT_duplicate");
- WM_operatortype_macro_define(ot, "TFM_OT_translate");
+ otmacro= WM_operatortype_macro_define(ot, "TFM_OT_translate");
+ RNA_enum_set(otmacro->ptr, "proportional", 0);
ot= WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", OPTYPE_UNDO|OPTYPE_REGISTER);
WM_operatortype_macro_define(ot, "MESH_OT_rip");
- WM_operatortype_macro_define(ot, "TFM_OT_translate");
+ otmacro= WM_operatortype_macro_define(ot, "TFM_OT_translate");
+ RNA_enum_set(otmacro->ptr, "proportional", 0);
ot= WM_operatortype_append_macro("MESH_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER);
WM_operatortype_macro_define(ot, "MESH_OT_extrude");
- WM_operatortype_macro_define(ot, "TFM_OT_translate");
-
+ otmacro= WM_operatortype_macro_define(ot, "TFM_OT_translate");
+ RNA_enum_set(otmacro->ptr, "proportional", 0);
}
/* note mesh keymap also for other space? */
WM_operatortype_append(OBJECT_OT_group_add);
WM_operatortype_append(OBJECT_OT_group_remove);
+}
+
+void ED_operatormacros_object(void)
+{
+ wmOperatorType *ot;
- /* macros */
ot= WM_operatortype_append_macro("OBJECT_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
if(ot) {
WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate");
spacetypes = BKE_spacetypes_list();
for(type=spacetypes->first; type; type=type->next)
type->operatortypes();
+
+
+ /* Macros's must go last since they reference other operators
+ * maybe we'll need to have them go after python operators too? */
+ ED_operatormacros_mesh();
+ ED_operatormacros_object();
}
/* called in wm.c */
/* operator id */
char idname[MAX_ID_NAME];
/* rna pointer to access properties, like keymap */
+ struct IDProperty *properties; /* operator properties, assigned to ptr->data and can be written to a file */
struct PointerRNA *ptr;
} wmOperatorTypeMacro;
/* operator */
char idname[64]; /* used to retrieve operator type pointer */
- IDProperty *properties; /* operator properties */
+ IDProperty *properties; /* operator properties, assigned to ptr->data and can be written to a file */
/* modal */
short propvalue; /* if used, the item is from modal map */
/* event */
short type; /* event code itself */
- short val; /* 0=any, 1=click, 2=release, or wheelvalue, or... */
+ short val; /* KM_ANY, KM_PRESS, KM_NOTHING etc */
short shift, ctrl, alt, oskey; /* oskey is apple or windowskey, value denotes order of pressed */
short keymodifier; /* rawkey modifier */
int WM_operator_name_call (struct bContext *C, const char *opstring, int context, struct PointerRNA *properties);
int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, int context, struct PointerRNA *properties, struct ReportList *reports);
+void WM_operator_properties_alloc(struct PointerRNA **ptr, struct IDProperty **properties, const char *opstring); /* used for keymap and macro items */
void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring);
void WM_operator_properties_free(struct PointerRNA *ptr);
void WM_operator_properties_filesel(struct wmOperatorType *ot, int filter, short type);
static void keymap_properties_set(wmKeyMapItem *kmi)
{
- if(!kmi->properties) {
- IDPropertyTemplate val = {0};
- kmi->properties= IDP_New(IDP_GROUP, val, "wmKeyMapItemProperties");
- }
-
- if(!kmi->ptr) {
- kmi->ptr= MEM_callocN(sizeof(PointerRNA), "wmKeyMapItemPtr");
- WM_operator_properties_create(kmi->ptr, kmi->idname);
- }
-
- kmi->ptr->data= kmi->properties;
+ WM_operator_properties_alloc(&(kmi->ptr), &(kmi->properties), kmi->idname);
}
wmKeyConfig *WM_keyconfig_add(wmWindowManager *wm, char *idname)
BLI_strncpy(otmacro->idname, idname, OP_MAX_TYPENAME);
/* do this on first use, since operatordefinitions might have been not done yet */
-// otmacro->ptr= MEM_callocN(sizeof(PointerRNA), "optype macro ItemPtr");
-// WM_operator_properties_create(otmacro->ptr, idname);
+ WM_operator_properties_alloc(&(otmacro->ptr), &(otmacro->properties), idname);
BLI_addtail(&ot->macro, otmacro);
RNA_pointer_create(NULL, &RNA_OperatorProperties, NULL, ptr);
}
+/* similar to the function above except its uses ID properties
+ * used for keymaps and macros */
+void WM_operator_properties_alloc(PointerRNA **ptr, IDProperty **properties, const char *opstring)
+{
+ if(*properties==NULL) {
+ IDPropertyTemplate val = {0};
+ *properties= IDP_New(IDP_GROUP, val, "wmOpItemProp");
+ }
+
+ if(*ptr==NULL) {
+ *ptr= MEM_callocN(sizeof(PointerRNA), "wmOpItemPtr");
+ WM_operator_properties_create(*ptr, opstring);
+ }
+
+ (*ptr)->data= *properties;
+
+}
+
+
void WM_operator_properties_free(PointerRNA *ptr)
{
IDProperty *properties= ptr->data;