Material: Appearance Updates 2

Improves the use of the ShapeAppearance property for the Part workbench.

    removes DiffuseColor property
        adds Python compatibility using custom attributes
        transitions DiffuseColor to ShapeAppearance on open
    Improved UI elements for setting object appearance, and appearance per face
    Lays the foundation for future texture support
This commit is contained in:
David Carter
2024-06-01 18:26:38 -04:00
committed by Chris Hennes
parent c4d0f3ed97
commit 5feb963f9d
55 changed files with 1540 additions and 714 deletions

View File

@@ -30,6 +30,7 @@
class SoPickedPointList;
class SoSwitch;
class SoSensor;
class SoTexture2;
class SbVec2s;
class SoBaseColor;
@@ -58,7 +59,6 @@ public:
// Display properties
App::PropertyPercent Transparency;
// App::PropertyMaterial ShapeMaterial; // Default appearance and physical properties
App::PropertyMaterialList ShapeAppearance; // May be different from material
App::PropertyBool BoundingBox;
App::PropertyBool Selectable;
@@ -108,13 +108,30 @@ protected:
void handleChangedPropertyName(Base::XMLReader& reader,
const char* TypeName,
const char* PropName) override;
void setCoinAppearance(const App::Material& source);
/**
* Select which appearance type is active
*
*/
/** Material only */
void activateMaterial();
/** 2D Texture */
void activateTexture2D();
/** 3D texture only */
void activateTexture3D();
/** Mix of material and 3D textures */
void activateMixed3D();
private:
void setSoMaterial(const App::Material& source);
bool isSelectionEnabled() const;
protected:
SoSwitch* pcSwitchAppearance {nullptr};
SoSwitch* pcSwitchTexture {nullptr};
SoMaterial* pcShapeMaterial {nullptr};
SoTexture2* pcShapeTexture2D {nullptr};
SoGroup* pcTextureGroup3D {nullptr};
SoFCBoundingBox* pcBoundingBox {nullptr};
SoSwitch* pcBoundSwitch {nullptr};
SoBaseColor* pcBoundColor {nullptr};