[Bf-blender-cvs] [2849dc4] temp_manipulators_core: Add SpaceType.manipulators callback for startup registration of manipulator-maps

Julian Eisel noreply at git.blender.org
Wed Sep 14 17:05:20 CEST 2016


Commit: 2849dc429bbae9bb9aa9e008f4482c3fa304d1eb
Author: Julian Eisel
Date:   Wed Sep 14 17:02:12 2016 +0200
Branches: temp_manipulators_core
https://developer.blender.org/rB2849dc429bbae9bb9aa9e008f4482c3fa304d1eb

Add SpaceType.manipulators callback for startup registration of manipulator-maps

Aaaannd the usual cleanup.

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

M	source/blender/blenkernel/BKE_screen.h
M	source/blender/editors/space_api/spacetypes.c
M	source/blender/windowmanager/manipulators/WM_manipulator_types.h

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

diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index cd8b520..3768074 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -96,6 +96,9 @@ typedef struct SpaceType {
 	/* on startup, define dropboxes for spacetype+regions */
 	void (*dropboxes)(void);
 
+	/* on startup, initialize manipulator-map-types and manipulator-group-types */
+	void (*manipulators)(void);
+
 	/* return context data */
 	int (*context)(const struct bContext *, const char *, struct bContextDataResult *);
 
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index ac6e312..2b4ca8d 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -121,12 +121,16 @@ void ED_spacetypes_init(void)
 	
 	ED_operatortypes_view2d();
 	ED_operatortypes_ui();
-	
-	/* register operators */
+
+	/* register types for operators and manipulators */
 	spacetypes = BKE_spacetypes_list();
 	for (type = spacetypes->first; type; type = type->next) {
-		if (type->operatortypes)
+		if (type->operatortypes) {
 			type->operatortypes();
+		}
+		if (type->manipulators) {
+			type->manipulators();
+		}
 	}
 
 	/* register internal render callbacks */
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_types.h b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
index 25ff546..6fc748f 100644
--- a/source/blender/windowmanager/manipulators/WM_manipulator_types.h
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
@@ -57,9 +57,9 @@ typedef struct wmManipulatorGroupType {
 	char idname[64];  /* MAX_NAME */
 	const char *name; /* manipulator-group name - displayed in UI (keymap editor) */
 
-	/* poll if manipulator-map should be active */
+	/* poll if manipulator-map should be visible */
 	wmManipulatorGroupPollFunc poll;
-	/* initially create manipulators, set permanent data stuff you only need to do once */
+	/* initially create manipulators and set permanent data - stuff you only need to do once */
 	wmManipulatorGroupInitFunc init;
 	/* refresh data, only called if recreate flag is set (WM_manipulatormap_tag_refresh) */
 	wmManipulatorGroupRefreshFunc refresh;




More information about the Bf-blender-cvs mailing list