Virtual base-class for all types of material alternatives.
The per-node-data is extracted from a node using the vitual method _getDataFromAppearance(). The data looks like this:
(base-material-ref, (layer-0-material-ref, layer-0-visibility), ...)
Depending upon the type of material alternative, the first or the second items in this list can be None.
#include
<class_alternative_set_1_1_material_alternative.h>
Public Member Functions |
|
__init__ () | |
This is a thread-safe set of node
identifiers. |
|
cleanup () | |
Cleanup any complex objects. |
|
add () | |
addWithData () | |
discard () | |
replace () | |
Remove some nodes from this alternative and
add others; however, when adding the nodes, don't use the current
materials on the nodes - instead, use the materials already
associated with one of the nodes to be removed. |
|
isCurrent () | |
Return True if the nodes associated with
this alternative already have the corresponding materials, and
False otherwise. |
|
activate () | |
Apply the materials in this alternative to
the associated nodes. |
|
activateFromData () | |
Given a sequence of node id + per-node-data
pairs, apply the materials to the nodes. |
|
getDataFromNode () | |
Given a node id, return the per-node-data.
|
|
getDataAsIds () | |
idsToMaterials () | |
Given a sequence of node ids + per-node-data
pairs, where the per-node-data contains material ids, return an
equivalent sequence containing the corresponding material
references. |
|
getMaterial () | |
For compatibility with the previous
MaterialAlternative
implementation. |
|
setMaterial () | |
For compatibility with the previous
MaterialAlternative
implementation. |
AlternativeSet.MaterialAlternative.__init__ | ( | ) |
This is a thread-safe set of node identifiers.
The interface to this class mimics the interface to the built-in set.
Reimplemented from AlternativeSet.Alternative.
Reimplemented in AlternativeSet.BaseMaterialAlternative, AlternativeSet.DecalMaterialAlternative, and AlternativeSet.FullMaterialAlternative.
AlternativeSet.MaterialAlternative.cleanup | ( | ) |
Cleanup any complex objects.
Reimplemented from AlternativeSet.Alternative.
AlternativeSet.MaterialAlternative.add | ( | ) |
Reimplemented from NodeContainers.NodeIdList.
AlternativeSet.MaterialAlternative.addWithData | ( | ) |
AlternativeSet.MaterialAlternative.discard | ( | ) |
Reimplemented from NodeContainers.NodeIdList.
AlternativeSet.MaterialAlternative.replace | ( | ) |
Remove some nodes from this alternative and add others; however, when adding the nodes, don't use the current materials on the nodes - instead, use the materials already associated with one of the nodes to be removed.
Reimplemented from AlternativeSet.Alternative.
AlternativeSet.MaterialAlternative.isCurrent | ( | ) |
Return True if the nodes associated with this alternative already have the corresponding materials, and False otherwise.
AlternativeSet.MaterialAlternative.activate | ( | ) |
Apply the materials in this alternative to the associated nodes.
AlternativeSet.MaterialAlternative.activateFromData | ( | ) |
Given a sequence of node id + per-node-data pairs, apply the materials to the nodes.
AlternativeSet.MaterialAlternative.getDataFromNode | ( | ) |
Given a node id, return the per-node-data.
AlternativeSet.MaterialAlternative.getDataAsIds | ( | ) |
AlternativeSet.MaterialAlternative.idsToMaterials | ( | ) |
Given a sequence of node ids + per-node-data pairs, where the per-node-data contains material ids, return an equivalent sequence containing the corresponding material references.
AlternativeSet.MaterialAlternative.getMaterial | ( | ) |
For compatibility with the previous MaterialAlternative implementation.
Currently used in unit tests, this should be eventually removed.
AlternativeSet.MaterialAlternative.setMaterial | ( | ) |
For compatibility with the previous MaterialAlternative implementation.
Currently used in unit tests, this should be eventually removed.