App/Gui: allow change dynamic property group and documentation
Exposed as PropertyContainerPy.setGroup/DocumentationOfProperty. Added a menu action to property view for rename dynamic property group.
This commit is contained in:
@@ -339,6 +339,25 @@ PyObject* PropertyContainerPy::getGroupOfProperty(PyObject *args)
|
||||
return Py::new_reference_to(Py::String(""));
|
||||
}
|
||||
|
||||
PyObject* PropertyContainerPy::setGroupOfProperty(PyObject *args)
|
||||
{
|
||||
char *pstr;
|
||||
char *group;
|
||||
if (!PyArg_ParseTuple(args, "ss", &pstr, &group)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
|
||||
PY_TRY {
|
||||
Property* prop = getPropertyContainerPtr()->getDynamicPropertyByName(pstr);
|
||||
if (!prop) {
|
||||
PyErr_Format(PyExc_AttributeError, "Property container has no dynamic property '%s'", pstr);
|
||||
return 0;
|
||||
}
|
||||
prop->getContainer()->changeDynamicProperty(prop,group,0);
|
||||
Py_Return;
|
||||
} PY_CATCH
|
||||
}
|
||||
|
||||
|
||||
PyObject* PropertyContainerPy::getDocumentationOfProperty(PyObject *args)
|
||||
{
|
||||
char *pstr;
|
||||
@@ -358,6 +377,24 @@ PyObject* PropertyContainerPy::getDocumentationOfProperty(PyObject *args)
|
||||
return Py::new_reference_to(Py::String(""));
|
||||
}
|
||||
|
||||
PyObject* PropertyContainerPy::setDocumentationOfProperty(PyObject *args)
|
||||
{
|
||||
char *pstr;
|
||||
char *doc;
|
||||
if (!PyArg_ParseTuple(args, "ss", &pstr, &doc)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
|
||||
PY_TRY {
|
||||
Property* prop = getPropertyContainerPtr()->getDynamicPropertyByName(pstr);
|
||||
if (!prop) {
|
||||
PyErr_Format(PyExc_AttributeError, "Property container has no dynamic property '%s'", pstr);
|
||||
return 0;
|
||||
}
|
||||
prop->getContainer()->changeDynamicProperty(prop,0,doc);
|
||||
Py_Return;
|
||||
} PY_CATCH
|
||||
}
|
||||
|
||||
PyObject* PropertyContainerPy::getEnumerationsOfProperty(PyObject *args)
|
||||
{
|
||||
char *pstr;
|
||||
|
||||
Reference in New Issue
Block a user