Skip to content

Latest commit

 

History

History
51 lines (42 loc) · 1.47 KB

File metadata and controls

51 lines (42 loc) · 1.47 KB

AddSubMtrlToMtrl

Description

Adds a Simple material to a Compound material. Sets the fraction of the Simple material as a relation to the whole. Fraction can have value between 0.0 and 1.0. "Primary" material is a simple material which carries the graphical attributes to be used by the compound material.

FUNCTION AddSubMtrlToMtrl(
				hMaterial   : HANDLE;
				subMtrlName : STRING;
				fraction    : REAL;
				makePrimary : BOOLEAN): Boolean;
def vs.AddSubMtrlToMtrl(hMaterial, subMtrlName, fraction, makePrimary):
    return Boolean

Parameters

Name Type Description
hMaterial HANDLE Handle of a Compound material
subMtrlName STRING Name of a Simple material to be added
fraction REAL Fraction of the Simple material
makePrimary BOOLEAN True if this Simple material should become the primary material of the Compound material

Examples

resultOK := AddSubMtrlToMtrl(hMaterial, 'Example', 1.0, TRUE);
import vs

# Adds a Simple material to a Compound material.
hMaterial = vs.FSActLayer()  # handle to the first selected object on the active layer
subMtrlName = 'Example'
fraction = 1.0
makePrimary = True

ok = vs.AddSubMtrlToMtrl(hMaterial, subMtrlName, fraction, makePrimary)
if ok:
    vs.Message('AddSubMtrlToMtrl succeeded')
else:
    vs.Message('AddSubMtrlToMtrl failed')

Version

Availability: from Vectorworks 2021

Category