Difference between revisions of "Attribute Class"

From Derivative
Jump to navigation Jump to search
Line 24: Line 24:
 
     |class=Attribute
 
     |class=Attribute
 
     |name=type
 
     |name=type
     |type=
+
     |type=type object
 
     |set=0
 
     |set=0
 
     |text=The type associated with this attribute: float, integer or string.
 
     |text=The type associated with this attribute: float, integer or string.
Line 31: Line 31:
 
     |class=Attribute
 
     |class=Attribute
 
     |name=name
 
     |name=name
     |type=
+
     |type=str
 
     |set=0
 
     |set=0
 
     |text=The name of this attribute.
 
     |text=The name of this attribute.
Line 38: Line 38:
 
     |class=Attribute
 
     |class=Attribute
 
     |name=owner
 
     |name=owner
     |type=
+
     |type=OP
 
     |set=0
 
     |set=0
 
     |text=The OP to which this object belongs.
 
     |text=The OP to which this object belongs.
Line 50: Line 50:
 
     |name=destroy
 
     |name=destroy
 
     |call=destroy()
 
     |call=destroy()
     |returns=
+
     |returns=None
     |text=:
+
     |text=Destroy the attribute referenced by this object.
Destroy the attribute referenced by this object.
+
<syntaxhighlight lang=python>
 
n = scriptOP.pointAttribs['N'].destroy()
 
n = scriptOP.pointAttribs['N'].destroy()
 +
</syntaxhighlight>
 
}}}}
 
}}}}
 
<section end=HELPBODY />
 
<section end=HELPBODY />
 
{{History}}
 
{{History}}
 
{{#invoke:Category|list|Python Reference}}
 
{{#invoke:Category|list|Python Reference}}

Revision as of 15:17, 29 September 2017

An Attribute describes a general geometric Attribute, associated with a Prim Class, Point Class, or Vertex Class. Specific values for each Prim, Point or Vertex are described with the AttributeData Class. Lists of attributes for the SOP are described with the Attributes Class.


Members[edit]

defaultvalue (Read Only):

The default values associated with this attribute. Dependent on the type of attribute, it may return a float, integer, string, tuple, Position, or Vector.

sizeint (Read Only):

The number of values associated with this attribute. For example, a normal attribute has a size of 3.

typetype object (Read Only):

The type associated with this attribute: float, integer or string.

namestr (Read Only):

The name of this attribute.

ownerOP (Read Only):

The OP to which this object belongs.

Methods[edit]

destroy()None:

Destroy the attribute referenced by this object.

n = scriptOP.pointAttribs['N'].destroy()

TouchDesigner Build: