Manipulator: name setting function
Default name includes group-name, we may want to set the name without a prefix.
This commit is contained in:
@@ -67,6 +67,8 @@ void WM_manipulator_free(
|
||||
ListBase *manipulatorlist, struct wmManipulatorMap *mmap, struct wmManipulator *mpr,
|
||||
struct bContext *C);
|
||||
|
||||
void WM_manipulator_name_set(struct wmManipulatorGroup *mgroup, struct wmManipulator *mpr, const char *name);
|
||||
|
||||
struct PointerRNA *WM_manipulator_set_operator(
|
||||
struct wmManipulator *, struct wmOperatorType *ot, struct IDProperty *properties);
|
||||
|
||||
|
||||
@@ -142,6 +142,15 @@ static void manipulator_unique_idname_set(wmManipulatorGroup *mgroup, wmManipula
|
||||
offsetof(wmManipulator, name), sizeof(mpr->name));
|
||||
}
|
||||
|
||||
void WM_manipulator_name_set(wmManipulatorGroup *mgroup, wmManipulator *mpr, const char *name)
|
||||
{
|
||||
BLI_strncpy(mpr->name, name, sizeof(mpr->name));
|
||||
|
||||
/* ensure name is unique, append '.001', '.002', etc if not */
|
||||
BLI_uniquename(&mgroup->manipulators, mpr, "Manipulator", '.',
|
||||
offsetof(wmManipulator, name), sizeof(mpr->name));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize default values and allocate needed memory for members.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user