Module vrMaterialPtr :: Class vrMaterialPtr
[frames] | no frames]

Class vrMaterialPtr

                 object --+            
                          |            
                ??.instance --+        
                              |        
vrFieldAccess.FieldContainerPtr --+    
                                  |    
                        MaterialPtr --+
                                      |
                                     vrMaterialPtr

Most functions of vrMaterialPtr are deprecated, use API v2 vrdMaterial types instead.

A wrapper class for the OpenSG MaterialPtr.

Instance Methods
 
__init__(source)
The constructor of the MaterialPtr class.
bool
addChunk(chunk)
Deprecated.
 
addMaterial(mat)
Deprecated: Use vrdMultiMaterial.materials.append(mat) in API v2.
vrMaterialPtr
copy()
Deprecated: Use vrMaterialService.duplicateMaterials([mat]) in API v2.
vrFieldAccess
fields()
Deprecated: Use API v2 material types instead to read and write material settings, e.g.
unsigned integer
getChoice()
Deprecated: Use vrdSwitchMaterial.getChoice() in API v2.
vrChunkPtr
getChunk(i)
Deprecated.
unsigned int (32bit)
getChunkCount()
Deprecated.
unsigned int (32bit)
getID()
Return the material id.
vrMaterialPtr
getMaterialByChoice(choice)
Deprecated: Use vrdSwitchMaterial.materials.at(choice) in API v2.
string
getName()
Deprecated: Use vrdMaterial.getName() in API v2.
list of vrNodePtrs
getNodes()
Deprecated: Use vrMaterialService.findNodesWithMaterial(mat) in API v2.
MaterialPtr
getPtr()
Return the OpenSG MaterialPtr.
vrSHLChunkPtr
getSHLChunk()
Deprecated.
list of vrMaterialPtrs
getSubMaterials()
Deprecated: Use vrdMultiMaterial.getMaterials() in API v2.
string
getType()
Deprecated.
bool
isAsset()
Deprecated: Use vrdMaterial.isAsset() in API v2.
bool
isValid()
See vrdSceneObject.isValid() in API v2.
 
setChoice(choice)
Deprecated: Use vrdSwitchMaterial.setChoice(choice) in API v2.
 
setMaterialChoiceByTag(tag)
Deprecated: Use vrMaterialService.setSwitchChoiceByAnyTag in API v2.
 
setMaterialChoiceByTags(tags, matchAllTags)
Deprecated: Use vrMaterialService.setSwitchChoiceByAnyTag or vrMaterialService.setSwitchChoiceByAllTags in API v2.
 
setName(name)
Deprecated: Use vrdMaterial.setName(name) in API v2.
 
setTransparency(t)
Deprecated: Use material.getTransparency().setSeeThrough(QVector3D(t, t, t)) in API v2.
 
sub(update)
Deprecated: Use vrMaterialService.deleteMaterials(mat) in API v2.
bool
subChunk(chunk)
Deprecated.
 
subMaterial(mat)
Deprecated: Use vrdMultiMaterial.materials.remove(mat) in API v2.

Inherited from vrFieldAccess.FieldContainerPtr: __reduce__

Inherited from unreachable.instance: __new__

Static Methods
 
removeAssetManagerReference(...)
For every material that is an asset, removes its reference to the Asset Manager.
Class Variables
  __instance_size__ = 64
Method Details

__init__(source)
(Constructor)

 

The constructor of the MaterialPtr class. There are three valid versions:

MaterialPtr() Creates a MaterialPtr object.

MaterialPtr(source) Creates a MaterialPtr object from an unsigned int.

MaterialPtr(source) Creates a MaterialPtr object from a MaterialPtr.

Parameters:
  • source (unsigned int or MaterialPtr) - The source (Optional).
Overrides: vrFieldAccess.FieldContainerPtr.__init__

addChunk(chunk)

 

Deprecated. See vrdChunkMaterial and vrdMaterialChunkList in API v2.

Adds a chunk to the material.

Parameters:
  • chunk (vrChunkPtr) - The chunk pointer.
Returns: bool
True on success, false otherwise.

addMaterial(mat)

 

Deprecated: Use vrdMultiMaterial.materials.append(mat) in API v2.

Adds a material to a switch material.

Parameters:
  • mat (vrMaterialPtr) - The material.

copy()

 

Deprecated: Use vrMaterialService.duplicateMaterials([mat]) in API v2.

Returns a copy of the material.

Returns: vrMaterialPtr
The copy.

fields()

 

Deprecated: Use API v2 material types instead to read and write material settings, e.g. vrdPlasticMaterial.

Returns the field access object to get access to all fields. Take a look at the vrFieldAccess documentation to see how to manipulate the value of the fields.

Returns: vrFieldAccess
The field access object.

getChoice()

 

Deprecated: Use vrdSwitchMaterial.getChoice() in API v2.

Returns the current choice of a switch material.

Returns: unsigned integer
The choice.

getChunk(i)

 

Deprecated. See vrdChunkMaterial and vrdMaterialChunkList in API v2.

Returns a chunk.

Parameters:
  • i (unsigned int (32bit)) - The index.
Returns: vrChunkPtr
The chunk

getChunkCount()

 

Deprecated. See vrdChunkMaterial and vrdMaterialChunkList in API v2.

Returns the chunk count.

Returns: unsigned int (32bit)
The chunk count.

getID()

 

Return the material id.

Returns: unsigned int (32bit)
The material id.

getMaterialByChoice(choice)

 

Deprecated: Use vrdSwitchMaterial.materials.at(choice) in API v2.

Returns the material of a switch material.

Parameters:
  • choice (unsigned int) - The choice.
Returns: vrMaterialPtr
The material.

getName()

 

Deprecated: Use vrdMaterial.getName() in API v2.

Returns the name of the material.

Returns: string
The name of the material.

getNodes()

 

Deprecated: Use vrMaterialService.findNodesWithMaterial(mat) in API v2.

Returns all nodes that are using this material.

Returns: list of vrNodePtrs
The nodes.

getPtr()

 

Return the OpenSG MaterialPtr.

Returns: MaterialPtr
The pointer.

getSHLChunk()

 

Deprecated. See vrdChunkMaterial and vrdGLSLShaderChunk in API v2.

Returns an opengl shading language chunk (if there is one within the material).

Returns: vrSHLChunkPtr
The chunk.

getSubMaterials()

 

Deprecated: Use vrdMultiMaterial.getMaterials() in API v2.

Returns all sub materials of the material.

Returns: list of vrMaterialPtrs
A list of materials.

getType()

 

Deprecated. Returns the OpenSG type of the material.

Returns: string
The type of the material.

isAsset()

 

Deprecated: Use vrdMaterial.isAsset() in API v2.

Checks if the material is an asset from the Asset Manager.

Returns: bool
True if the material is an asset, false otherwise.

isValid()

 

See vrdSceneObject.isValid() in API v2.

Return true when the material is valid. Should be called for sanity reasons after searching a material with findMaterial.

Returns: bool
True when the material is valid, false otherwise.

removeAssetManagerReference(...)
Static Method

 

For every material that is an asset, removes its reference to the Asset Manager.

For environment materials it removes the reference to the environment asset.

Updates the Material Editor (and Scenegraph, if an environment asset reference is deleted) UI afterwards.

Parameters:
  • mat (list of vrMaterialPtr) - The list of materials.

setChoice(choice)

 

Deprecated: Use vrdSwitchMaterial.setChoice(choice) in API v2.

Sets the choice of a switch material.

Parameters:
  • choice (unsigned int) - The choice.

setMaterialChoiceByTag(tag)

 

Deprecated: Use vrMaterialService.setSwitchChoiceByAnyTag in API v2.

Sets the current choice of the switch to the material with the tag.

Parameters:
  • tag (string) - The choice.

setMaterialChoiceByTags(tags, matchAllTags)

 

Deprecated: Use vrMaterialService.setSwitchChoiceByAnyTag or vrMaterialService.setSwitchChoiceByAllTags in API v2.

Sets the current choice of the switch to the material with the tags.

Parameters:
  • tags (string) - The list of tag strings to check.
  • matchAllTags (bool) - If true only materials which contain all give tags are returns. If false any material that contains at least one tag is returned.

setName(name)

 

Deprecated: Use vrdMaterial.setName(name) in API v2.

Sets the name of the material.

Parameters:
  • name (string) - The new name of the material.

setTransparency(t)

 

Deprecated: Use material.getTransparency().setSeeThrough(QVector3D(t, t, t)) in API v2.

Sets the transparency.

Parameters:
  • t (float) - The transparency.

sub(update)

 

Deprecated: Use vrMaterialService.deleteMaterials(mat) in API v2.

Removes the material from the material pool.

Parameters:
  • update (bool) - If true the material editor is updated (Optional). Default is true.

subChunk(chunk)

 

Deprecated. See vrdChunkMaterial and vrdMaterialChunkList in API v2.

Subs a chunk from the material.

Parameters:
  • chunk (vrChunkPtr) - The chunk pointer.
Returns: bool
True on success, false otherwise.

subMaterial(mat)

 

Deprecated: Use vrdMultiMaterial.materials.remove(mat) in API v2.

Subs a material from a switch material.

Parameters:
  • mat (vrMaterialPtr) - The material.