Difference between revisions of "Attribute Class"

From Derivative
Jump to navigation Jump to search
(Attribute Class Auto Create)
m
Tags: 2018.28070 2021.10000
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{TDClassSummary|summary=An Attribute describes a general geometric Attribute, associated with a Prim Class, Point Class, or Vertex Class.
+
{{TDClassSummary|label=Attribute|summary=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.
+
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.}}
+
Lists of attributes for the [[SOP Class|SOP]] are described with the [[Attributes Class]].}}
{{HelpbodyBegin}}
+
<section begin=HELPBODY />
 
{{ClassMemberSection|empty=
 
{{ClassMemberSection|empty=
 
|Sectionsummary=
 
|Sectionsummary=
 
|items=
 
|items=
 
 
{{ClassMember
 
{{ClassMember
 
     |class=Attribute
 
     |class=Attribute
     |name=default
+
     |name=owner
     |returns=
+
     |type=OP
 
     |set=0
 
     |set=0
     |text=The default values associated with this attribute. Dependent on the type of attribute, it may return a float, integer, string, tuple, Position, or Vector.
+
     |text=The [[OP Class|OP]] to which this object belongs.}}
}}
 
 
{{ClassMember
 
{{ClassMember
 
     |class=Attribute
 
     |class=Attribute
     |name=size
+
     |name=name
     |returns=
+
     |type=str
 
     |set=0
 
     |set=0
     |text=The number of values associated with this attribute.  For example, a normal attribute has a size of 3.
+
     |text=The name of this attribute.
 
}}
 
}}
 
{{ClassMember
 
{{ClassMember
 
     |class=Attribute
 
     |class=Attribute
     |name=type
+
     |name=size
     |returns=
+
     |type=int
 
     |set=0
 
     |set=0
     |text=The type associated with this attribute:  float, integer or string.
+
     |text=The number of values associated with this attribute. For example, a normal attribute has a size of 3.
 
}}
 
}}
 
{{ClassMember
 
{{ClassMember
 
     |class=Attribute
 
     |class=Attribute
     |name=name
+
     |name=type
     |returns=
+
     |type=type object
 
     |set=0
 
     |set=0
     |text=The name of this attribute.
+
     |text=The type associated with this attribute: float, integer or string.
 
}}
 
}}
 
{{ClassMember
 
{{ClassMember
 
     |class=Attribute
 
     |class=Attribute
     |name=owner
+
     |name=default
     |returns=
+
     |type=value
 
     |set=0
 
     |set=0
     |text=The OP to which this object belongs.
+
     |text=The default values associated with this attribute. Dependent on the type of attribute, it may return a float, integer, string, tuple, [[Position Class|Position]], or [[Vector Class|Vector]].}}}}
}}}}
 
 
{{ClassMethodSection|empty=
 
{{ClassMethodSection|empty=
 
|Sectionsummary=
 
|Sectionsummary=
Line 50: Line 47:
 
     |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>
 
}}}}
 
}}}}
{{{{HelpbodyEnd}}}}
+
{{SubSection|title=Accessing Attributes
{{{{History}}}}
+
|text=See [[Attributes Class|Attributes]] for examples on how to access individual attributes.
{{{{#invoke:Category|list|Python Reference}}}}
+
}}
 +
<section end=HELPBODY />
 +
{{History}}
 +
{{#invoke:Category|list|Python Reference}}

Latest revision as of 13:51, 11 January 2019

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]

ownerOP (Read Only):

The OP to which this object belongs.

namestr (Read Only):

The name of this attribute.

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.

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.

Methods[edit]

destroy()None:

Destroy the attribute referenced by this object.

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

Accessing Attributes[edit]

See Attributes for examples on how to access individual attributes.


TouchDesigner Build: