Fix related to [#31157]: Tips (descriptions) of macro operators were not set into underlying RNA struct, hence did not show up in UI.
This commit is contained in:
parent
e9ac31bee4
commit
fef40eda72
@ -171,17 +171,19 @@ void ED_operatormacros_armature(void)
|
||||
wmOperatorType *ot;
|
||||
wmOperatorTypeMacro *otmacro;
|
||||
|
||||
ot = WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
ot = WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate",
|
||||
"Make copies of the selected bones within the same armature and move them",
|
||||
OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
if (ot) {
|
||||
ot->description = "Make copies of the selected bones within the same armature and move them";
|
||||
WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
}
|
||||
|
||||
ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude",
|
||||
"Create new bones from the selected joints and move them",
|
||||
OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
if (ot) {
|
||||
ot->description = "Create new bones from the selected joints and move them";
|
||||
otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
|
||||
RNA_boolean_set(otmacro->ptr, "forked", FALSE);
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
@ -190,9 +192,10 @@ void ED_operatormacros_armature(void)
|
||||
|
||||
// XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate?
|
||||
// that would require fixing a properties bug 19733
|
||||
ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked",
|
||||
"Create new bones from the selected joints and move them",
|
||||
OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
if (ot) {
|
||||
ot->description = "Create new bones from the selected joints and move them";
|
||||
otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
|
||||
RNA_boolean_set(otmacro->ptr, "forked", TRUE);
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
|
@ -140,15 +140,15 @@ void ED_operatormacros_curve(void)
|
||||
wmOperatorType *ot;
|
||||
wmOperatorTypeMacro *otmacro;
|
||||
|
||||
ot = WM_operatortype_append_macro("CURVE_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
ot->description = "Duplicate curve and move";
|
||||
ot = WM_operatortype_append_macro("CURVE_OT_duplicate_move", "Add Duplicate", "Duplicate curve and move",
|
||||
OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
WM_operatortype_macro_define(ot, "CURVE_OT_duplicate");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
|
||||
|
||||
ot = WM_operatortype_append_macro("CURVE_OT_extrude_move", "Extrude Curve and Move", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
ot->description = "Extrude curve and move result";
|
||||
ot = WM_operatortype_append_macro("CURVE_OT_extrude_move", "Extrude Curve and Move",
|
||||
"Extrude curve and move result", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
WM_operatortype_macro_define(ot, "CURVE_OT_extrude");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
|
@ -197,49 +197,49 @@ void ED_operatormacros_mesh(void)
|
||||
wmOperatorType *ot;
|
||||
wmOperatorTypeMacro *otmacro;
|
||||
|
||||
ot = WM_operatortype_append_macro("MESH_OT_loopcut_slide", "Loop Cut and Slide", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
ot->description = "Cut mesh loop and slide it";
|
||||
ot = WM_operatortype_append_macro("MESH_OT_loopcut_slide", "Loop Cut and Slide", "Cut mesh loop and slide it",
|
||||
OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
WM_operatortype_macro_define(ot, "MESH_OT_loopcut");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_edge_slide");
|
||||
RNA_struct_idprops_unset(otmacro->ptr, "release_confirm");
|
||||
|
||||
ot = WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
ot->description = "Duplicate mesh and move";
|
||||
ot = WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", "Duplicate mesh and move",
|
||||
OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
WM_operatortype_macro_define(ot, "MESH_OT_duplicate");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
|
||||
|
||||
ot = WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
ot->description = "Rip polygons and move the result";
|
||||
ot = WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", "Rip polygons and move the result",
|
||||
OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
WM_operatortype_macro_define(ot, "MESH_OT_rip");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
|
||||
|
||||
ot = WM_operatortype_append_macro("MESH_OT_extrude_region_move", "Extrude Region and Move", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
ot->description = "Extrude region and move result";
|
||||
ot = WM_operatortype_append_macro("MESH_OT_extrude_region_move", "Extrude Region and Move",
|
||||
"Extrude region and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_region");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
|
||||
|
||||
ot = WM_operatortype_append_macro("MESH_OT_extrude_faces_move", "Extrude Individual Faces and Move", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
ot->description = "Extrude faces and move result";
|
||||
ot = WM_operatortype_append_macro("MESH_OT_extrude_faces_move", "Extrude Individual Faces and Move",
|
||||
"Extrude faces and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_faces_indiv");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
|
||||
|
||||
ot = WM_operatortype_append_macro("MESH_OT_extrude_edges_move", "Extrude Only Edges and Move", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
ot->description = "Extrude edges and move result";
|
||||
ot = WM_operatortype_append_macro("MESH_OT_extrude_edges_move", "Extrude Only Edges and Move",
|
||||
"Extrude edges and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_edges_indiv");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
|
||||
|
||||
ot = WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", "Extrude Only Vertices and Move", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
ot->description = "Extrude vertices and move result";
|
||||
ot = WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", "Extrude Only Vertices and Move",
|
||||
"Extrude vertices and move result", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
otmacro = WM_operatortype_macro_define(ot, "MESH_OT_extrude_verts_indiv");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", 0);
|
||||
|
@ -222,18 +222,18 @@ void ED_operatormacros_object(void)
|
||||
wmOperatorType *ot;
|
||||
wmOperatorTypeMacro *otmacro;
|
||||
|
||||
ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move", "Duplicate Objects", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move", "Duplicate Objects",
|
||||
"Duplicate selected objects and move them", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
if (ot) {
|
||||
ot->description = "Duplicate selected objects and move them";
|
||||
WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_enum_set(otmacro->ptr, "proportional", PROP_EDIT_OFF);
|
||||
}
|
||||
|
||||
/* grr, should be able to pass options on... */
|
||||
ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move_linked", "Duplicate Linked", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
ot = WM_operatortype_append_macro("OBJECT_OT_duplicate_move_linked", "Duplicate Linked",
|
||||
"Duplicate selected objects and move them", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
if (ot) {
|
||||
ot->description = "Duplicate selected objects and move them";
|
||||
otmacro = WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate");
|
||||
RNA_boolean_set(otmacro->ptr, "linked", TRUE);
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
@ -241,9 +241,9 @@ void ED_operatormacros_object(void)
|
||||
}
|
||||
|
||||
/* XXX */
|
||||
ot = WM_operatortype_append_macro("OBJECT_OT_add_named_cursor", "Add named object at cursor", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
ot = WM_operatortype_append_macro("OBJECT_OT_add_named_cursor", "Add Named At Cursor",
|
||||
"Add named object at cursor", OPTYPE_UNDO | OPTYPE_REGISTER);
|
||||
if (ot) {
|
||||
ot->description = "Add named object at cursor";
|
||||
RNA_def_string(ot->srna, "name", "Cube", MAX_ID_NAME - 2, "Name", "Object name to add");
|
||||
|
||||
WM_operatortype_macro_define(ot, "VIEW3D_OT_cursor3d");
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include "action_intern.h"
|
||||
|
||||
#include "RNA_access.h"
|
||||
#include "RNA_define.h"
|
||||
|
||||
#include "WM_api.h"
|
||||
#include "WM_types.h"
|
||||
@ -93,9 +94,10 @@ void ED_operatormacros_action(void)
|
||||
wmOperatorType *ot;
|
||||
wmOperatorTypeMacro *otmacro;
|
||||
|
||||
ot = WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
ot = WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate",
|
||||
"Make a copy of all selected keyframes and move them",
|
||||
OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
if (ot) {
|
||||
ot->description = "Make a copy of all selected keyframes and move them";
|
||||
WM_operatortype_macro_define(ot, "ACTION_OT_duplicate");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
|
||||
RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
|
||||
|
@ -1093,14 +1093,15 @@ void ED_operatormacros_clip(void)
|
||||
wmOperatorType *ot;
|
||||
wmOperatorTypeMacro *otmacro;
|
||||
|
||||
ot = WM_operatortype_append_macro("CLIP_OT_add_marker_move", "Add Marker and Move", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
ot->description = "Add new marker and move it on movie";
|
||||
ot = WM_operatortype_append_macro("CLIP_OT_add_marker_move", "Add Marker and Move",
|
||||
"Add new marker and move it on movie", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
WM_operatortype_macro_define(ot, "CLIP_OT_add_marker");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_struct_idprops_unset(otmacro->ptr, "release_confirm");
|
||||
|
||||
ot = WM_operatortype_append_macro("CLIP_OT_add_marker_slide", "Add Marker and Slide", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
ot->description = "Add new marker and slide it with mouse until mouse button release";
|
||||
ot = WM_operatortype_append_macro("CLIP_OT_add_marker_slide", "Add Marker and Slide",
|
||||
"Add new marker and slide it with mouse until mouse button release",
|
||||
OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
WM_operatortype_macro_define(ot, "CLIP_OT_add_marker");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_boolean_set(otmacro->ptr, "release_confirm", TRUE);
|
||||
|
@ -241,9 +241,10 @@ void ED_operatormacros_graph(void)
|
||||
wmOperatorType *ot;
|
||||
wmOperatorTypeMacro *otmacro;
|
||||
|
||||
ot = WM_operatortype_append_macro("GRAPH_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
ot = WM_operatortype_append_macro("GRAPH_OT_duplicate_move", "Duplicate",
|
||||
"Make a copy of all selected keyframes and move them",
|
||||
OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
if (ot) {
|
||||
ot->description = "Make a copy of all selected keyframes and move them";
|
||||
WM_operatortype_macro_define(ot, "GRAPH_OT_duplicate");
|
||||
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
|
||||
RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
|
||||
|
@ -111,30 +111,31 @@ void ED_operatormacros_node(void)
|
||||
wmOperatorType *ot;
|
||||
wmOperatorTypeMacro *mot;
|
||||
|
||||
ot = WM_operatortype_append_macro("NODE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
ot->description = "Duplicate selected nodes and move them";
|
||||
ot = WM_operatortype_append_macro("NODE_OT_duplicate_move", "Duplicate", "Duplicate selected nodes and move them",
|
||||
OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
WM_operatortype_macro_define(ot, "NODE_OT_duplicate");
|
||||
WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
|
||||
/* modified operator call for duplicating with input links */
|
||||
ot = WM_operatortype_append_macro("NODE_OT_duplicate_move_keep_inputs", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
ot->description = "Duplicate selected nodes keeping input links and move them";
|
||||
ot = WM_operatortype_append_macro("NODE_OT_duplicate_move_keep_inputs", "Duplicate",
|
||||
"Duplicate selected nodes keeping input links and move them",
|
||||
OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
mot = WM_operatortype_macro_define(ot, "NODE_OT_duplicate");
|
||||
RNA_boolean_set(mot->ptr, "keep_inputs", TRUE);
|
||||
WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
|
||||
ot = WM_operatortype_append_macro("NODE_OT_select_link_viewer", "Link Viewer", OPTYPE_UNDO);
|
||||
ot->description = "Select node and link it to a viewer node";
|
||||
ot = WM_operatortype_append_macro("NODE_OT_select_link_viewer", "Link Viewer",
|
||||
"Select node and link it to a viewer node", OPTYPE_UNDO);
|
||||
WM_operatortype_macro_define(ot, "NODE_OT_select");
|
||||
WM_operatortype_macro_define(ot, "NODE_OT_link_viewer");
|
||||
|
||||
ot = WM_operatortype_append_macro("NODE_OT_move_detach_links", "Detach", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
ot->description = "Move a node to detach links";
|
||||
ot = WM_operatortype_append_macro("NODE_OT_move_detach_links", "Detach", "Move a node to detach links",
|
||||
OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
WM_operatortype_macro_define(ot, "NODE_OT_links_detach");
|
||||
WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
|
||||
ot = WM_operatortype_append_macro("NODE_OT_move_detach_links_release", "Detach", OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
ot->description = "Move a node to detach links";
|
||||
ot = WM_operatortype_append_macro("NODE_OT_move_detach_links_release", "Detach", "Move a node to detach links",
|
||||
OPTYPE_UNDO|OPTYPE_REGISTER);
|
||||
WM_operatortype_macro_define(ot, "NODE_OT_links_detach");
|
||||
mot = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
|
||||
RNA_boolean_set(mot->ptr, "release_confirm", TRUE);
|
||||
|
@ -188,7 +188,7 @@ void WM_operatortype_append_ptr (void (*opfunc)(struct wmOperatorType*, void *)
|
||||
void WM_operatortype_append_macro_ptr (void (*opfunc)(struct wmOperatorType*, void *), void *userdata);
|
||||
int WM_operatortype_remove(const char *idname);
|
||||
|
||||
struct wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *name, int flag);
|
||||
struct wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag);
|
||||
struct wmOperatorTypeMacro *WM_operatortype_macro_define(struct wmOperatorType *ot, const char *idname);
|
||||
|
||||
|
||||
|
@ -346,7 +346,7 @@ static int wm_macro_cancel(bContext *C, wmOperator *op)
|
||||
}
|
||||
|
||||
/* Names have to be static for now */
|
||||
wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *name, int flag)
|
||||
wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag)
|
||||
{
|
||||
wmOperatorType *ot;
|
||||
|
||||
@ -360,6 +360,7 @@ wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *nam
|
||||
|
||||
ot->idname = idname;
|
||||
ot->name = name;
|
||||
ot->description = description;
|
||||
ot->flag = OPTYPE_MACRO | flag;
|
||||
|
||||
ot->exec = wm_macro_exec;
|
||||
|
Loading…
Reference in New Issue
Block a user