diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-06-26 08:57:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-06-26 09:38:04 +0300 |
commit | 28b2f1c30504ce0e437b21f7964282fcd6894421 (patch) | |
tree | 8653eeeb0edb90cf41a93bc2b196ac55739f2a32 /source/blenderplayer | |
parent | c9e33b36de25d272a9896ad0a85dcc69ee0692ba (diff) |
Manipulator: Python API
Initial support for Python/Manipulator integration
from 'custom-manipulators' branch.
Supports:
- Registering custom manipulators & manipulator-groups.
- Modifying RNA properties, custom values via get/set callbacks,
or invoking an operator.
- Drawing shape presets for Python defined manipulators (arrow, circle, face-maps)
Limitations:
- Only float properties supported.
- Drawing only supported via shape presets.
(we'll likely want a way to define custom geometry or draw directly).
- When to refresh, recalculate manipulators will likely need
integration with notifier system.
Development will be continued in the 2.8 branch
Diffstat (limited to 'source/blenderplayer')
-rw-r--r-- | source/blenderplayer/bad_level_call_stubs/stubs.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 30f67a38420..ea0a28d57f7 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -133,6 +133,7 @@ struct wmOperator; struct wmOperatorType; struct wmWindow; struct wmWindowManager; +struct wmManipulatorGroupType; struct wmManipulatorMap; @@ -164,6 +165,7 @@ struct wmManipulatorMap; #include "../blender/editors/include/ED_keyframes_edit.h" #include "../blender/editors/include/ED_keyframing.h" #include "../blender/editors/include/ED_lattice.h" +#include "../blender/editors/include/ED_manipulator_library.h" #include "../blender/editors/include/ED_mball.h" #include "../blender/editors/include/ED_mesh.h" #include "../blender/editors/include/ED_node.h" @@ -186,6 +188,7 @@ struct wmManipulatorMap; #include "../blender/gpu/GPU_immediate.h" #include "../blender/gpu/GPU_matrix.h" #include "../blender/python/BPY_extern.h" +#include "../blender/python/intern/bpy_manipulator_wrap.h" #include "../blender/render/extern/include/RE_engine.h" #include "../blender/render/extern/include/RE_pipeline.h" #include "../blender/render/extern/include/RE_render_ext.h" @@ -358,6 +361,31 @@ void WM_jobs_callbacks(struct wmJob *job, void WM_jobs_start(struct wmWindowManager *wm, struct wmJob *job) RET_NONE void WM_report(ReportType type, const char *message) RET_NONE +void BPY_RNA_manipulatorgroup_wrapper(struct wmManipulatorGroupType *wgt, void *userdata) RET_NONE +void BPY_RNA_manipulator_wrapper(struct wmManipulatorType *wgt, void *userdata) RET_NONE + +PointerRNA *WM_manipulator_set_operator(struct wmManipulator *mpr, struct wmOperatorType *ot, struct IDProperty *properties) RET_NULL +const struct wmManipulatorPropertyType *WM_manipulatortype_target_property_find(const struct wmManipulatorType *wt, const char *idname) RET_NULL +const struct wmManipulatorType *WM_manipulatortype_find(const char *idname, bool quiet) RET_NULL +struct wmManipulator *WM_manipulator_new_ptr(const struct wmManipulatorType *wt, struct wmManipulatorGroup *mgroup, const char *name, struct PointerRNA *properties) RET_NULL +struct wmManipulatorGroupType *WM_manipulatorgrouptype_append_ptr(void (*mnpfunc)(struct wmManipulatorGroupType *, void *), void *userdata) RET_NULL +struct wmManipulatorGroupType *WM_manipulatorgrouptype_find(const char *idname, bool quiet) RET_NULL +void WM_manipulator_free(ListBase *manipulatorlist, struct wmManipulatorMap *mmap, struct wmManipulator *mpr, struct bContext *C) RET_NONE +void WM_manipulator_group_add_ptr(struct wmManipulatorGroupType *wgt) RET_NONE +void WM_manipulator_group_add_ptr_ex(struct wmManipulatorGroupType *wgt, struct wmManipulatorMapType *mmap_type) RET_NONE +void WM_manipulator_group_remove_ptr(struct Main *bmain, struct wmManipulatorGroupType *wgt) RET_NONE +void WM_manipulator_name_set(struct wmManipulatorGroup *mgroup, struct wmManipulator *mpr, const char *name) RET_NONE +void WM_manipulator_target_property_def_rna_ptr(struct wmManipulator *mpr, const struct wmManipulatorPropertyType *mpr_prop_type, struct PointerRNA *ptr, struct PropertyRNA *prop, int index) RET_NONE +void WM_manipulatorgrouptype_remove_ptr(struct wmManipulatorGroupType *wt) RET_NONE +void WM_manipulatormaptype_group_unlink(struct bContext *C, struct Main *bmain, struct wmManipulatorMapType *mmap_type, const struct wmManipulatorGroupType *wgt) RET_NONE +void WM_manipulatortype_append_ptr(void (*mnpfunc)(struct wmManipulatorType *, void *), void *userdata) RET_NONE +void WM_manipulatortype_remove_ptr(struct wmManipulatorType *wt) RET_NONE + +void ED_manipulator_draw_preset_box(const struct wmManipulator *mpr, float mat[4][4], int select_id) RET_NONE +void ED_manipulator_draw_preset_arrow(const struct wmManipulator *mpr, float mat[4][4], int axis, int select_id) RET_NONE +void ED_manipulator_draw_preset_circle(const struct wmManipulator *mpr, float mat[4][4], int axis, int select_id) RET_NONE +void ED_manipulator_draw_preset_facemap(const struct wmManipulator *mpr, struct Scene *scene, struct Object *ob, const int facemap, int select_id) RET_NONE + struct wmManipulatorMapType *WM_manipulatormaptype_find(const struct wmManipulatorMapType_Params *wmap_params) RET_NULL struct wmManipulatorMapType *WM_manipulatormaptype_ensure(const struct wmManipulatorMapType_Params *wmap_params) RET_NULL struct wmManipulatorMap *WM_manipulatormap_new_from_type(const struct wmManipulatorMapType_Params *wmap_params) RET_NULL |