Difference between revisions of "SOP Class"

From Derivative
Jump to navigation Jump to search
(SOP Class Auto Create)
Line 8: Line 8:
 
     |class=SOP
 
     |class=SOP
 
     |name=center
 
     |name=center
     |type=
+
     |type=tdu.Position
     |set=0
+
     |set=1
 
     |text=Get or set the barycentric coordinate of this operator's geometry. It is expressed as a Position.
 
     |text=Get or set the barycentric coordinate of this operator's geometry. It is expressed as a Position.
 
}}
 
}}
Line 15: Line 15:
 
     |class=SOP
 
     |class=SOP
 
     |name=compare
 
     |name=compare
     |type=
+
     |type=bool
     |set=0
+
     |set=1
 
     |text=Get or set compare flag.
 
     |text=Get or set compare flag.
 
}}
 
}}
Line 22: Line 22:
 
     |class=SOP
 
     |class=SOP
 
     |name=isSOP
 
     |name=isSOP
     |type=
+
     |type=bool
 
     |set=0
 
     |set=0
 
     |text=True if the operator is a SOP.
 
     |text=True if the operator is a SOP.
Line 29: Line 29:
 
     |class=SOP
 
     |class=SOP
 
     |name=max
 
     |name=max
     |type=
+
     |type=tdu.Position
 
     |set=0
 
     |set=0
 
     |text=The maximum coordinates of this operator's geometry along each dimension, expressed as Position.
 
     |text=The maximum coordinates of this operator's geometry along each dimension, expressed as Position.
Line 36: Line 36:
 
     |class=SOP
 
     |class=SOP
 
     |name=min
 
     |name=min
     |type=
+
     |type=tdu.Position
 
     |set=0
 
     |set=0
 
     |text=The minimum coordinates of this operator's geometry along each dimension, expressed as a Position.
 
     |text=The minimum coordinates of this operator's geometry along each dimension, expressed as a Position.
Line 43: Line 43:
 
     |class=SOP
 
     |class=SOP
 
     |name=numPoints
 
     |name=numPoints
     |type=
+
     |type=int
 
     |set=0
 
     |set=0
 
     |text=The number of points contained in this SOP.
 
     |text=The number of points contained in this SOP.
Line 50: Line 50:
 
     |class=SOP
 
     |class=SOP
 
     |name=numPrims
 
     |name=numPrims
     |type=
+
     |type=int
 
     |set=0
 
     |set=0
 
     |text=The number of primitivies contained in this SOP.
 
     |text=The number of primitivies contained in this SOP.
Line 57: Line 57:
 
     |class=SOP
 
     |class=SOP
 
     |name=pointAttribs
 
     |name=pointAttribs
     |type=
+
     |type=td.Attributes
 
     |set=0
 
     |set=0
 
     |text=The set of point attributes defined in this SOP.
 
     |text=The set of point attributes defined in this SOP.
Line 64: Line 64:
 
     |class=SOP
 
     |class=SOP
 
     |name=points
 
     |name=points
     |type=
+
     |type=td.Points
 
     |set=0
 
     |set=0
 
     |text=The set of points contained in this SOP.
 
     |text=The set of points contained in this SOP.
Line 71: Line 71:
 
     |class=SOP
 
     |class=SOP
 
     |name=primAttribs
 
     |name=primAttribs
     |type=
+
     |type=td.Attributes
 
     |set=0
 
     |set=0
 
     |text=The set of primitive attributes defined in this SOP.
 
     |text=The set of primitive attributes defined in this SOP.
Line 78: Line 78:
 
     |class=SOP
 
     |class=SOP
 
     |name=prims
 
     |name=prims
     |type=
+
     |type=int
 
     |set=0
 
     |set=0
 
     |text=The set of primitives contained in this SOP.
 
     |text=The set of primitives contained in this SOP.
Line 85: Line 85:
 
     |class=SOP
 
     |class=SOP
 
     |name=size
 
     |name=size
     |type=
+
     |type=tdu.Position
 
     |set=0
 
     |set=0
 
     |text=The size of this operator's geometry along each dimension, expressed as a Position.
 
     |text=The size of this operator's geometry along each dimension, expressed as a Position.
Line 92: Line 92:
 
     |class=SOP
 
     |class=SOP
 
     |name=template
 
     |name=template
     |type=
+
     |type=bool
 
     |set=0
 
     |set=0
 
     |text=Get or set template flag.
 
     |text=Get or set template flag.
Line 99: Line 99:
 
     |class=SOP
 
     |class=SOP
 
     |name=vertexAttribs
 
     |name=vertexAttribs
     |type=
+
     |type=td.Attributes
 
     |set=0
 
     |set=0
 
     |text=The set of vertex attributes defined in this SOP.
 
     |text=The set of vertex attributes defined in this SOP.
Line 111: Line 111:
 
     |name=save
 
     |name=save
 
     |call=save(filepath)
 
     |call=save(filepath)
     |returns=
+
     |returns=filepath
     |text=: -> filepath
+
     |text=Saves the geometry to the file system. Multiple file types are supported. Returns the filename and path saved.
Saves the geometry to the file system. Multiple file types are supported. Returns the filename and path saved.
+
*filepath - (Optional) The path and filename to save to. If not given then a default filename will be used, and the file will be saved in the project.folder folder.
filepath - (Optional) The path and filename to save to. If not given then a default filename will be used, and the file will be saved in the project.folder folder.
+
<syntaxhighlight lang=python>
 
name = n.save()  #save in native format with default name.
 
name = n.save()  #save in native format with default name.
 
n.save('output.bgeo')  #alternate format compatible with some other modelling packages.
 
n.save('output.bgeo')  #alternate format compatible with some other modelling packages.
 +
<syntaxhighlight>
 
}}}}
 
}}}}
 
<section end=HELPBODY />
 
<section end=HELPBODY />
 
{{History}}
 
{{History}}
 
{{#invoke:Category|list|Python Reference}}
 
{{#invoke:Category|list|Python Reference}}

Revision as of 14:29, 25 September 2017

A SOP describes a reference to a SOP operator, containing points and primitives.


Members[edit]

centertdu.Position :

Get or set the barycentric coordinate of this operator's geometry. It is expressed as a Position.

comparebool :

Get or set compare flag.

isSOPbool (Read Only):

True if the operator is a SOP.

maxtdu.Position (Read Only):

The maximum coordinates of this operator's geometry along each dimension, expressed as Position.

mintdu.Position (Read Only):

The minimum coordinates of this operator's geometry along each dimension, expressed as a Position.

numPointsint (Read Only):

The number of points contained in this SOP.

numPrimsint (Read Only):

The number of primitivies contained in this SOP.

pointAttribstd.Attributes (Read Only):

The set of point attributes defined in this SOP.

pointstd.Points (Read Only):

The set of points contained in this SOP.

primAttribstd.Attributes (Read Only):

The set of primitive attributes defined in this SOP.

primsint (Read Only):

The set of primitives contained in this SOP.

sizetdu.Position (Read Only):

The size of this operator's geometry along each dimension, expressed as a Position.

templatebool (Read Only):

Get or set template flag.

vertexAttribstd.Attributes (Read Only):

The set of vertex attributes defined in this SOP.

Methods[edit]

save(filepath)filepath:

Saves the geometry to the file system. Multiple file types are supported. Returns the filename and path saved.

  • filepath - (Optional) The path and filename to save to. If not given then a default filename will be used, and the file will be saved in the project.folder folder.

<syntaxhighlight lang=python> name = n.save() #save in native format with default name. n.save('output.bgeo') #alternate format compatible with some other modelling packages.

<syntaxhighlight>

TouchDesigner Build: