| 516 | } |
| 517 | |
| 518 | PyObject* MaterialPy::getAppearanceValue(PyObject* args) |
| 519 | { |
| 520 | char* name; |
| 521 | if (!PyArg_ParseTuple(args, "s", &name)) { |
| 522 | return nullptr; |
| 523 | } |
| 524 | |
| 525 | if (!getMaterialPtr()->hasAppearanceProperty(QString::fromStdString(name))) { |
| 526 | Py_RETURN_NONE; |
| 527 | } |
| 528 | |
| 529 | auto property = getMaterialPtr()->getAppearanceProperty(QString::fromStdString(name)); |
| 530 | if (!property) { |
| 531 | Py_RETURN_NONE; |
| 532 | } |
| 533 | |
| 534 | if (property->getType() == MaterialValue::Array2D) { |
| 535 | auto value = |
| 536 | std::static_pointer_cast<Materials::Array2D>(property->getMaterialValue()); |
| 537 | return new Array2DPy(new Array2D(*value)); |
| 538 | } |
| 539 | if (property->getType() == MaterialValue::Array3D) { |
| 540 | auto value = |
| 541 | std::static_pointer_cast<Materials::Array3D>(property->getMaterialValue()); |
| 542 | return new Array3DPy(new Array3D(*value)); |
| 543 | } |
| 544 | |
| 545 | QVariant value = property->getValue(); |
| 546 | return _pyObjectFromVariant(value); |
| 547 | } |
| 548 | |
| 549 | PyObject* MaterialPy::setAppearanceValue(PyObject* args) |
| 550 | { |
nothing calls this directly
no test coverage detected