Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-10-02 09:59:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-10-02 10:03:23 +0300
commit07d4580f644577ebbd49f7d9a2bd8a81561cc099 (patch)
tree268e8a78e00389f136391c1d00e2020eb9f472a4 /source/blender/python/intern/bpy_gizmo_wrap.c
parentdce12293d0dbaf0ae1e2ea90dc46ae7e40763f31 (diff)
Gizmo: support for gizmo-group properties
This allows gizmo groups to store properties in the tool. This makes sense for gizmo options which only control gizmo display and don't control operator execution. Unlike similar kinds of properties, this isn't accessible via the gizmo-group-type instance. For now the it's only stored in the workspace tool as can be done for operator properties, so each instance doesn't have different settings which would be confusing from a user perspective and complicate access from the top-bar. Later we could add gizmo-group properties if needed.
Diffstat (limited to 'source/blender/python/intern/bpy_gizmo_wrap.c')
-rw-r--r--source/blender/python/intern/bpy_gizmo_wrap.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/source/blender/python/intern/bpy_gizmo_wrap.c b/source/blender/python/intern/bpy_gizmo_wrap.c
index 2a932cb6a99..411822ee4da 100644
--- a/source/blender/python/intern/bpy_gizmo_wrap.c
+++ b/source/blender/python/intern/bpy_gizmo_wrap.c
@@ -192,37 +192,30 @@ void BPY_RNA_gizmo_wrapper(wmGizmoType *gzt, void *userdata)
static void gizmogroup_properties_init(wmGizmoGroupType *gzgt)
{
-#ifdef USE_SRNA
PyTypeObject *py_class = gzgt->ext.data;
-#endif
RNA_struct_blender_type_set(gzgt->ext.srna, gzgt);
-#ifdef USE_SRNA
/* only call this so pyrna_deferred_register_class gives a useful error
* WM_operatortype_append_ptr will call RNA_def_struct_identifier
* later */
- RNA_def_struct_identifier(gzgt->srna, gzgt->idname);
+ RNA_def_struct_identifier_no_struct_map(gzgt->srna, gzgt->idname);
if (pyrna_deferred_register_class(gzgt->srna, py_class) != 0) {
PyErr_Print(); /* failed to register operator props */
PyErr_Clear();
}
-#endif
}
void BPY_RNA_gizmogroup_wrapper(wmGizmoGroupType *gzgt, void *userdata)
{
/* take care not to overwrite anything set in
* WM_gizmomaptype_group_link_ptr before opfunc() is called */
-#ifdef USE_SRNA
StructRNA *srna = gzgt->srna;
-#endif
*gzgt = *((wmGizmoGroupType *)userdata);
-#ifdef USE_SRNA
gzgt->srna = srna; /* restore */
-#endif
-#ifdef USE_SRNA
+ /* don't do translations here yet */
+#if 0
/* Use i18n context from ext.srna if possible (py gizmogroups). */
if (gzgt->ext.srna) {
RNA_def_struct_translation_context(gzgt->srna, RNA_struct_translation_context(gzgt->ext.srna));