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:
Diffstat (limited to 'source/blender/windowmanager/manipulators/intern/wm_manipulator.c')
-rw-r--r--source/blender/windowmanager/manipulators/intern/wm_manipulator.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
index b71cfdb15cf..f24bdb6e697 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
@@ -66,22 +66,26 @@ static void wm_manipulator_register(
* \note Follow #wm_operator_create convention.
*/
static wmManipulator *wm_manipulator_create(
- const wmManipulatorType *mpt)
+ const wmManipulatorType *wt)
{
- BLI_assert(mpt != NULL);
- BLI_assert(mpt->struct_size >= sizeof(wmManipulator));
+ BLI_assert(wt != NULL);
+ BLI_assert(wt->struct_size >= sizeof(wmManipulator));
- wmManipulator *mpr = MEM_callocN(mpt->struct_size, __func__);
- mpr->type = mpt;
+ wmManipulator *mpr = MEM_callocN(wt->struct_size, __func__);
+ mpr->type = wt;
return mpr;
}
-wmManipulator *WM_manipulator_new_ptr(const wmManipulatorType *mpt, wmManipulatorGroup *mgroup, const char *name)
+wmManipulator *WM_manipulator_new_ptr(const wmManipulatorType *wt, wmManipulatorGroup *mgroup, const char *name)
{
- wmManipulator *mpr = wm_manipulator_create(mpt);
+ wmManipulator *mpr = wm_manipulator_create(wt);
wm_manipulator_register(mgroup, mpr, name);
+ if (mpr->type->setup != NULL) {
+ mpr->type->setup(mpr);
+ }
+
return mpr;
}
@@ -93,11 +97,7 @@ wmManipulator *WM_manipulator_new_ptr(const wmManipulatorType *mpt, wmManipulato
wmManipulator *WM_manipulator_new(const char *idname, wmManipulatorGroup *mgroup, const char *name)
{
const wmManipulatorType *wt = WM_manipulatortype_find(idname, false);
- wmManipulator *mpr = wm_manipulator_create(wt);
-
- wm_manipulator_register(mgroup, mpr, name);
-
- return mpr;
+ return WM_manipulator_new_ptr(wt, mgroup, name);
}
/**