性質模組

本 properties 模組介紹動態屬性的描述。

class substance_painter.properties.Property(handle: _substance_painter.data_tweak.PythonTweak) substance_painter.properties.Property

物業資料的唯讀存取權。

參數:​handle (_substance_painter.data_tweak.PythonTweak)

value() -> bool |int |元組[int, int] |元組[int, int, int] |元組[int, int, int,] int | float |元組[float, float] , float |元組[float, float, float] |顏色 |元組[顏色, float] |元組[float, float, float,] float | str substance_painter.properties.Property.value

取得當前房產價值。

回報: 當前價值。

回傳類型: PropertyValue

name() -> str substance_painter.properties.Property.name

取得房產名稱。

退貨: 物業名稱。

回傳類型: 力量

short_name() -> 力量 substance_painter.properties.Property.short_name

取得縮寫的房產名稱。

退還: 物業的簡稱。

回傳類型: 力量

label() -> str substance_painter.properties.Property.label

拿到房產標籤。

退貨: 物業標籤。

回傳類型: 力量

widget_type() -> str substance_painter.properties.Property.widget_type

取得應該用來編輯屬性的 widget 類型。

退貨:

其中一個是:「滑桿」、「角度」、「顏色」、「切換按鈕」、「組合框」、「隨機種子」、「檔案」、「檔案清單」、「行編輯」、「資源」、「文字編輯」。

回傳類型: 力量

enum_values() -> Dict[str, int] substance_painter.properties.Property.enum_values

「Combobox」小工具類型可能的枚舉值與對應文字。

回傳: Enum 標籤轉為 enum value 字典。

**回傳類型:**Dict[ str, int]

enum_value(enum_label: str) -> int substance_painter.properties.Property.enum_value

取得 ‘Combobox’ 小工具類型所指定的列舉標籤的列舉值。

參數:​enum_label (str) – 有效的 enum 標籤。

回傳: 對應標籤的列舉值。

**回傳類型:**Dict[ str, int]

屬性() -> Dict[str,任意] substance_painter.properties.Property.properties

取得一個 json 物件,描述該屬性所有可用的元屬性。 例如:值範圍、編輯器步驟、可能值、工具提示等等。

回傳: 一個 json 物件。

**回傳類型:**Dict[ str、任意]

recommendation-more-help
substance-3d-dev-help-painter-python-guide