[Bf-blender-cvs] [0997fd51e28] custom-manipulators: Merge branch '28' into custom-manipulators

Campbell Barton noreply at git.blender.org
Fri Jun 23 07:51:58 CEST 2017


Commit: 0997fd51e282ab7d7befe4086a0a1864ccc88f93
Author: Campbell Barton
Date:   Fri Jun 23 15:54:57 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rB0997fd51e282ab7d7befe4086a0a1864ccc88f93

Merge branch '28' into custom-manipulators

===================================================================



===================================================================

diff --cc source/blender/makesrna/intern/rna_wm_manipulator.c
index 5926779c5fd,06e31688a8a..2cc3e441506
--- a/source/blender/makesrna/intern/rna_wm_manipulator.c
+++ b/source/blender/makesrna/intern/rna_wm_manipulator.c
@@@ -1053,130 -205,6 +1053,130 @@@ static void rna_def_manipulatorgroup(Bl
  	RNA_def_struct_ui_text(srna, "ManipulatorGroup", "Storage of an operator being executed, or registered after execution");
  	RNA_def_struct_sdna(srna, "wmManipulatorGroup");
  	RNA_def_struct_refine_func(srna, "rna_ManipulatorGroup_refine");
 +#ifdef WITH_PYTHON
 +	RNA_def_struct_register_funcs(
 +	        srna,
 +	        "rna_ManipulatorGroup_register",
 +	        "rna_ManipulatorGroup_unregister",
 +	        "rna_ManipulatorGroup_instance");
 +#endif
 +	RNA_def_struct_translation_context(srna, BLT_I18NCONTEXT_OPERATOR_DEFAULT);
 +
 +	/* -------------------------------------------------------------------- */
 +	/* Registration */
 +
 +	RNA_define_verify_sdna(0); /* not in sdna */
 +
 +	prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
 +	RNA_def_property_string_sdna(prop, NULL, "type->idname");
 +	RNA_def_property_string_maxlength(prop, MAX_NAME);
 +	RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ManipulatorGroup_bl_idname_set");
 +	RNA_def_property_flag(prop, PROP_REGISTER);
 +	RNA_def_struct_name_property(srna, prop);
 +
 +	prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
 +	RNA_def_property_string_sdna(prop, NULL, "type->name");
 +	RNA_def_property_string_maxlength(prop, MAX_NAME); /* else it uses the pointer size! */
 +	RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ManipulatorGroup_bl_label_set");
 +	/* RNA_def_property_clear_flag(prop, PROP_EDITABLE); */
 +	RNA_def_property_flag(prop, PROP_REGISTER);
 +
 +	prop = RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE);
 +	RNA_def_property_enum_sdna(prop, NULL, "type->mmap_params.spaceid");
 +	RNA_def_property_enum_items(prop, rna_enum_space_type_items);
 +	RNA_def_property_flag(prop, PROP_REGISTER);
 +	RNA_def_property_ui_text(prop, "Space type", "The space where the panel is going to be used in");
 +
 +	prop = RNA_def_property(srna, "bl_region_type", PROP_ENUM, PROP_NONE);
 +	RNA_def_property_enum_sdna(prop, NULL, "type->mmap_params.regionid");
 +	RNA_def_property_enum_items(prop, rna_enum_region_type_items);
 +	RNA_def_property_flag(prop, PROP_REGISTER);
 +	RNA_def_property_ui_text(prop, "Region Type", "The region where the panel is going to be used in");
 +
 +	/* bl_options */
 +	static EnumPropertyItem manipulatorgroup_flag_items[] = {
 +		{WM_MANIPULATORGROUPTYPE_3D, "3D", 0, "3D",
 +		 "Use in 3D viewport"},
- 		{WM_MANIPULATORGROUPTYPE_SCALE_3D, "SCALE_3D", 0, "Scale 3D",
- 		 "Scale manipulators as 3D object that respects zoom (otherwise zoom independent draw size)"},
++		{WM_MANIPULATORGROUPTYPE_SCALE, "SCALE", 0, "Scale",
++		 "Scale to respect zoom (otherwise zoom independent draw size)"},
 +		{WM_MANIPULATORGROUPTYPE_DEPTH_3D, "DEPTH_3D", 0, "Depth 3D",
 +		 "Supports culled depth by other objects in the view"},
 +		{WM_MANIPULATORGROUPTYPE_SELECT, "SELECT", 0, "Select",
 +		 "Supports selection"},
 +		{WM_MANIPULATORGROUPTYPE_PERSISTENT, "PERSISTENT", 0, "Persistent",
 +		 ""},
 +		{0, NULL, 0, NULL, NULL}
 +	};
 +	prop = RNA_def_property(srna, "bl_options", PROP_ENUM, PROP_NONE);
 +	RNA_def_property_enum_sdna(prop, NULL, "type->flag");
 +	RNA_def_property_enum_items(prop, manipulatorgroup_flag_items);
 +	RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL | PROP_ENUM_FLAG);
 +	RNA_def_property_ui_text(prop, "Options",  "Options for this operator type");
 +
 +	RNA_define_verify_sdna(1); /* not in sdna */
 +
 +
 +	/* Functions */
 +
 +	/* poll */
 +	func = RNA_def_function(srna, "poll", NULL);
 +	RNA_def_function_ui_description(func, "Test if the manipulator group can be called or not");
 +	RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_REGISTER_OPTIONAL);
 +	RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", ""));
 +	parm = RNA_def_pointer(func, "context", "Context", "", "");
 +	RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
 +
 +	/* keymap_init */
 +	func = RNA_def_function(srna, "setup_keymap", NULL);
 +	RNA_def_function_ui_description(
 +	        func,
 +	        "Initialize keymaps for this manipulator group, use fallback keymap when not present");
 +	RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_REGISTER_OPTIONAL);
 +	parm = RNA_def_pointer(func, "keyconf", "KeyConfig", "", "");
 +	RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
 +	parm = RNA_def_property(func, "manipulator_group", PROP_STRING, PROP_NONE);
 +	RNA_def_property_ui_text(parm, "Manipulator Group", "Manipulator Group ID");
 +	// RNA_def_property_string_default(parm, "");
 +	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
 +	/* return */
 +	parm = RNA_def_pointer(func, "keymap", "KeyMap", "", "");
 +	RNA_def_property_flag(parm, PROP_NEVER_NULL);
 +	RNA_def_function_return(func, parm);
 +
 +	/* setup */
 +	func = RNA_def_function(srna, "setup", NULL);
 +	RNA_def_function_ui_description(func, "Create manipulators function for the manipulator group");
 +	RNA_def_function_flag(func, FUNC_REGISTER);
 +	parm = RNA_def_pointer(func, "context", "Context", "", "");
 +	RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
 +
 +	/* refresh */
 +	func = RNA_def_function(srna, "refresh", NULL);
 +	RNA_def_function_ui_description(func, "Refresh data (called on common state changes such as selection)");
 +	RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
 +	parm = RNA_def_pointer(func, "context", "Context", "", "");
 +	RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
 +
 +	func = RNA_def_function(srna, "draw_prepare", NULL);
 +	RNA_def_function_ui_description(func, "Run before each redraw");
 +	RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
 +	parm = RNA_def_pointer(func, "context", "Context", "", "");
 +	RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
 +
 +	/* -------------------------------------------------------------------- */
 +	/* Instance Variables */
 +
 +	prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
 +	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +	RNA_def_property_string_funcs(prop, "rna_ManipulatorGroup_name_get", "rna_ManipulatorGroup_name_length", NULL);
 +	RNA_def_property_ui_text(prop, "Name", "");
 +
 +	prop = RNA_def_property(srna, "has_reports", PROP_BOOLEAN, PROP_NONE);
 +	RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* this is 'virtual' property */
 +	RNA_def_property_boolean_funcs(prop, "rna_ManipulatorGroup_has_reports_get", NULL);
 +	RNA_def_property_ui_text(prop, "Has Reports",
 +	                         "ManipulatorGroup has a set of reports (warnings and errors) from last execution");
 +
  
  	RNA_define_verify_sdna(0); /* not in sdna */




More information about the Bf-blender-cvs mailing list