Pcf Classes (How it all goes together)
A pcf file is a collection of elements. Each element has a collection of Attributes. Here are the classes used to represent the various element types and their attributes.
Representing pcf elements
-
class valvepcf.PcfNode(ename, etype, edesc='', euuid=None)[source]
An abstract class to represent different types of pcf elements
and hold their collections of attributes
-
__init__(ename, etype, edesc='', euuid=None)[source]
- Parameters:
ename (str) – the element’s name
etype (str) – the element’s type
edesc (str, optional) – the element’s description
euuid (str, optional) – the element’s uuid (autogenerated if not provided)
-
_type
- Type:
(str) - The element’s type.
-
_name
- Type:
(str) - The element’s name.
-
_uuid
- Type:
(str) - The element’s uuid (generally autogenerated).
-
_desc
- Type:
(str) - The element’s description.
-
attributes
- Type:
(list[PcfAttribute]) - The element’s list of attributes.
-
__repr__(indent=0, operator='')[source]
A printable summary of the PcfNode and its child nodes.
- Returns:
A Python formated string.
- Return type:
str
-
class valvepcf.PcfRootNode(ename, etype, edesc='', euuid=None)[source]
Bases: PcfNode
PcfRootNode is the top level structure which includes a collection of
PcfSystemNode as well as pcf format and schema versions.
-
__init__(ename, etype, edesc='', euuid=None)[source]
- Parameters:
ename (str) – the element’s name
etype (str) – the element’s type
edesc (str, optional) – the element’s description
euuid (str, optional) – the element’s uuid (autogenerated if not provided)
-
binary_format
- Type:
(str) Always ‘dmx’
-
binary_version
- Type:
(int) Ranges from 2 to 5
-
pcf_format
- Type:
(str) ‘dmx’ or ‘pcf’
-
pcf_version
- Type:
(int) Ranges from 1 to 2
-
systems
- Type:
(list[PcfSystemNode]) List of particle systems
-
attributes
- Type:
(list[PcfAttribute]) - The element’s list of attributes.
-
class valvepcf.PcfSystemNode(ename, etype, edesc='', euuid=None)[source]
Bases: PcfNode
PcfSystemNode is used to define a pcf system which regroups multiple
PcfOperatorNode. Operators are separated in specialized lists.
-
__init__(ename, etype, edesc='', euuid=None)[source]
- Parameters:
ename (str) – the element’s name
etype (str) – the element’s type
edesc (str, optional) – the element’s description
euuid (str, optional) – the element’s uuid (autogenerated if not provided)
-
renderers
- Type:
(list[PcfOperatorNode]) - list of renderers
-
operators
- Type:
(list[PcfOperatorNode]) - list of operators
-
initializers
- Type:
(list[PcfOperatorNode]) - list of initializers
-
emitters
- Type:
(list[PcfOperatorNode]) - list of emmiters
-
children
- Type:
(list[PcfRefNode]) - list of childrens
-
forces
- Type:
(list[PcfOperatorNode]) - list of forces
-
constraints
- Type:
(list[PcfOperatorNode]) - list of constraints
-
attributes
- Type:
(list[PcfAttribute]) - The element’s list of attributes.
-
class valvepcf.PcfOperatorNode(ename, etype, edesc='', euuid=None)[source]
Bases: PcfNode
PcfOperatorNode is used to hold specific collection of attributes for
PcfSystemNode.
-
__init__(ename, etype, edesc='', euuid=None)
- Parameters:
ename (str) – the element’s name
etype (str) – the element’s type
edesc (str, optional) – the element’s description
euuid (str, optional) – the element’s uuid (autogenerated if not provided)
-
attributes
- Type:
(list[PcfAttribute]) - The element’s list of attributes.
-
class valvepcf.PcfRefNode(ename, etype, edesc='', euuid=None)[source]
Bases: PcfNode
PcfRefNode is used to create child relationships between particle systems.
-
__init__(ename, etype, edesc='', euuid=None)[source]
- Parameters:
ename (str) – the element’s name
etype (str) – the element’s type
edesc (str, optional) – the element’s description
euuid (str, optional) – the element’s uuid (autogenerated if not provided)
-
ref
- Type:
(PcfSystemNode) - reference an other system
-
attributes
- Type:
(list[PcfAttribute]) - The element’s list of attributes.
Representing pcf attributes
-
class valvepcf.PcfAttribute(name, type, data)[source]
PcfAttribute represents an attribute held by an element.
-
__init__(name, type, data)[source]
- Parameters:
name – The attribute’s name.
type – The attribute’s type.
data – The attribute’s value.
-
_name
- Type:
(str) - Name of the attribute
-
_type
- Type:
(int) - Ranges (1-28), defines the type of _data
-
_data
The attribute’s value, can be one of many different types, must match _type