Skip to content
Arkueid edited this page Jan 28, 2025 · 1 revision

透明度控制

部件指 Part

相关接口:

class LAppModel:
    ...

    def GetPartCount() -> int:
        pass

    def GetPartId(index: int) -> str:
        pass

    def GetPartIds() -> list[str]:
        pass

    def SetPartOpacity(index: int, opacity: float) -> None:
        pass

用例:

# 输出可控制部件总数
log.Debug(f"Part Count: {model.GetPartCount()}")
# 获取 part 名称的字符串数组
partIds = model.GetPartIds()
log.Debug(f"Part Ids: {partIds}")
# 设置部件 PartHairBack 的透明度为 50%
model.SetPartOpacity(partIds.index("PartHairBack"), 0.5)

颜色控制

class LAppModel:
    def SetPartScreenColor(self, partIndex: int, r: float, g: float, b: float, a: float):
        ...
    
    def GetPartScreenColor(self, partIndex: int) -> tuple[float]:
        ...

    def SetPartMultiplyColor(self, partIndex: int, r: float, g: float, b: float, a: float):
        ...
    
    def GetPartMultiplyColor(self, partIndex: int) -> tuple[float]:
        ...
Clone this wiki locally