FxCmd

From Fracture FX
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''fxCmd pointCloud <fracture node>''' Regenerate the point cloud for voronoi-style breaking '''fxCmd createBody [fxWorld node] <input mesh shape|plug>''' Add a new rigid b...")
 
(2 intermediate revisions by one user not shown)
Line 2: Line 2:
  
 
Regenerate the point cloud for voronoi-style breaking
 
Regenerate the point cloud for voronoi-style breaking
 +
  
 
'''fxCmd createBody [fxWorld node] <input mesh shape|plug>'''
 
'''fxCmd createBody [fxWorld node] <input mesh shape|plug>'''
Line 7: Line 8:
 
Add a new rigid body to the simulator, whose shape is defined by the mesh on the given shape or plug. Plug identifies an element of in_mesh[] on the simulator/world-node. Normally called from the initialize script, but can be run at any time.
 
Add a new rigid body to the simulator, whose shape is defined by the mesh on the given shape or plug. Plug identifies an element of in_mesh[] on the simulator/world-node. Normally called from the initialize script, but can be run at any time.
  
'''fxCmd fractureBody [fxWorld node] <body ID> <fracture logical-index>'''
 
  
Break a rigid body using the fracturing node connected to the simulator at the given index. Normally called from the script of a collision event, but can be run at any time. The body is removed from the simulator and replaced with one or more shards. Returns an int array of the body IDs of all resulting shards.
+
'''fxCmd fractureBody [fxWorld node] <body ID> [collider ID (or -1)] <break-geo node>'''
 +
 
 +
Break a rigid body using the given node. Normally called from the script of a collision event, but can be run at any time. The body is removed from the simulator and replaced with one or more shards. Returns an int array of the body IDs of all resulting shards. The optional collider ID is the body used for localized breaking.
 +
 
  
 
'''fxCmd hasFracture [fxWorld node] <fracture logical-index>'''
 
'''fxCmd hasFracture [fxWorld node] <fracture logical-index>'''
  
 
Return non-zero if a fracture node is connected to the simulator at the given element of in_fxFracture
 
Return non-zero if a fracture node is connected to the simulator at the given element of in_fxFracture
 +
  
 
'''fxCmd hasBody [fxWorld node] <body ID>'''
 
'''fxCmd hasBody [fxWorld node] <body ID>'''
  
 
Return non-zero if a body with the given ID still exists in the simulation. When a body is fractured it is removed from the simulation and replaced with one or more shards, each with their own ID
 
Return non-zero if a body with the given ID still exists in the simulation. When a body is fractured it is removed from the simulation and replaced with one or more shards, each with their own ID
 +
  
 
'''fxCmd hasAttr [fxWorld node] <body ID> <name>'''
 
'''fxCmd hasAttr [fxWorld node] <body ID> <name>'''
  
 
Return non-zero if custom data of the given name exists on the given rigid body
 
Return non-zero if custom data of the given name exists on the given rigid body
 +
  
 
'''fxCmd getAttr [fxWorld node] <body ID> <name>'''
 
'''fxCmd getAttr [fxWorld node] <body ID> <name>'''
  
 
Return the value of named custom data on a rigid body. If the data doesn't exist 0 is returned. You can distinguish between non-existing data, and existing data with the value 0, using the hasAttr call.
 
Return the value of named custom data on a rigid body. If the data doesn't exist 0 is returned. You can distinguish between non-existing data, and existing data with the value 0, using the hasAttr call.
 +
  
 
'''fxCmd setAttr [fxworld node] <body ID> <name> <type> <value>'''
 
'''fxCmd setAttr [fxworld node] <body ID> <name> <type> <value>'''
  
 
Set named custom data on a body. Type is one of: bool/int/float/vector/string. Overwrites any existing data on that body with the same name.
 
Set named custom data on a body. Type is one of: bool/int/float/vector/string. Overwrites any existing data on that body with the same name.
 +
  
 
'''fxCmd addParams <node>'''
 
'''fxCmd addParams <node>'''
  
 
Add attributes to a shape node to hold dynamics parameters. Rigid bodies derived from this node will inherit the dynamics parameters
 
Add attributes to a shape node to hold dynamics parameters. Rigid bodies derived from this node will inherit the dynamics parameters
 +
  
 
'''fxCmd listFilterTypes'''
 
'''fxCmd listFilterTypes'''
Line 39: Line 48:
 
List all available filter types supported by the plug-in.
 
List all available filter types supported by the plug-in.
  
'''fxCmd contactQuery [fxWorld node] <-count | -pairs | -bodies>'''
 
 
To be used in the script of a collision event. Returns info about the bodies that passed all the filters for the event.
 
-count : The number of pairs of colliding bodies that passed all filters
 
-pairs : Returns an int array containing pairs of IDs of the colliding bodies which passed all filters. The size of the resulting array is always even, since it holds pairs of body IDs. One body may appear in the list multiple times (ie. in multiple pairs), since it could have collided with more than one other body.
 
-bodies : Returns the IDs of colliding bodies across all pairs. The returned int array is a unique list of bodies involved in any number of collisions. Each body appears in the list exactly once.
 
  
 
'''fxCmd listCustomData <node>'''
 
'''fxCmd listCustomData <node>'''
Line 50: Line 53:
 
Return a string array listing the names and types of custom data on the given shape node. Name/type pairs are interleaved in the returned array. The values of those attributes will be copied to custom data on when a rigid body is created from that shape node. Attributes on the node are prefixed with "fxAttr".
 
Return a string array listing the names and types of custom data on the given shape node. Name/type pairs are interleaved in the returned array. The values of those attributes will be copied to custom data on when a rigid body is created from that shape node. Attributes on the node are prefixed with "fxAttr".
  
'''fxCmd fractureBody [fxWorld node] <body ID> [collider ID (or -1)] <break-geo node>'''
 
  
Break a rigid body using the given node. Normally called from the script of a collision event, but can be run at any time. The body is removed from the simulator and replaced with one or more shards. Returns an int array of the body IDs of all resulting shards. The optional collider ID is the body used for localized breaking.
 
  
 
'''fxCmd contactQuery [fxWorld node] <-count | -pairs | -unique_pairs -bodies>'''
 
'''fxCmd contactQuery [fxWorld node] <-count | -pairs | -unique_pairs -bodies>'''
  
 
To be used in the script of a collision event. Returns info about the bodies that passed all the filters for the event.
 
To be used in the script of a collision event. Returns info about the bodies that passed all the filters for the event.
-count : The number of pairs of colliding bodies that passed all filters
+
:-count : The number of pairs of colliding bodies that passed all filters
-pairs : Returns an int array containing pairs of IDs of the colliding bodies which passed all filters. The size of the resulting array is always even, since it holds pairs of body IDs. One body may appear in the list multiple times (ie. in multiple pairs), since it could have collided with more than one other body.
+
:-pairs : Returns an int array containing pairs of IDs of the colliding bodies which passed all filters. The size of the resulting array is always even, since it holds pairs of body IDs. One body may appear in the list multiple times (ie. in multiple pairs), since it could have collided with more than one other body.
-unique_pairs : The same as -pairs, but with the constraint that each body (other than the ground plane) will appear at most once in the entire list; this means that not all colliding pairs are listed. Used to avoid a call to fracture_body more than once per body when that body is involved in multiple collisions during one time step.
+
:-unique_pairs : The same as -pairs, but with the constraint that each body (other than the ground plane) will appear at most once in the entire list; this means that not all colliding pairs are listed. Used to avoid a call to fracture_body more than once per body when that body is involved in multiple collisions during one time step.
-bodies : Returns the IDs of colliding bodies across all pairs. The returned int array is a unique list of bodies involved in any number of collisions. Each body appears in the list exactly once.
+
:-bodies : Returns the IDs of colliding bodies across all pairs. The returned int array is a unique list of bodies involved in any number of collisions. Each body appears in the list exactly once.
 +
 
  
 
'''fxCmd bakeToKeys <take log idx> <simulator node>'''
 
'''fxCmd bakeToKeys <take log idx> <simulator node>'''
  
 
Bake the simulation to keyframes, overwriting the take at the given index
 
Bake the simulation to keyframes, overwriting the take at the given index
 +
  
 
'''fxCmd clearTake <take log idx> <simulator node>'''
 
'''fxCmd clearTake <take log idx> <simulator node>'''
  
 
Remove all animcurves on all input objects and shards for the given take.
 
Remove all animcurves on all input objects and shards for the given take.
 +
 
'''
 
'''
 
fxCmd replaceWithKeys <take log idx> <simulator node>'''
 
fxCmd replaceWithKeys <take log idx> <simulator node>'''
  
 
Remove the simulator, break-geo nodes, and reconnect all animcurves for the take at the given index into the corresponding transform nodes.
 
Remove the simulator, break-geo nodes, and reconnect all animcurves for the take at the given index into the corresponding transform nodes.
 +
 +
 +
'''fxCmd modify {intArray of body IDs} [opp body ID]'''
 +
 +
Run the given rigid bodies through the modifier list for the current event. Callable from the script of collide and anim events. Optionally pass the ID of the opposing body in a collision pair, for modifiers that support it.
 +
 +
 +
'''fxCmd animQuery [-bodies]'''
 +
 +
Return the IDs of rigid bodies that passed the filter list of an animEvent. Should be used in the script of an animEvent.
 +
 +
 +
'''fxCmd setInitialState [nodes ...]'''
 +
 +
If no args are specified, set the initial state for selected objects; otherwise assume all string args are the names of nodes to set the state for.
 +
 +
 +
'''fxCmd listUniqueCustomData {nodes}'''
 +
 +
Return an interleaved array of the names and types of all custom data used across the nodes in the input string array. Data with the same name on several nodes appears once.

Revision as of 00:57, 10 May 2012

fxCmd pointCloud <fracture node>

Regenerate the point cloud for voronoi-style breaking


fxCmd createBody [fxWorld node] <input mesh shape|plug>

Add a new rigid body to the simulator, whose shape is defined by the mesh on the given shape or plug. Plug identifies an element of in_mesh[] on the simulator/world-node. Normally called from the initialize script, but can be run at any time.


fxCmd fractureBody [fxWorld node] <body ID> [collider ID (or -1)] <break-geo node>

Break a rigid body using the given node. Normally called from the script of a collision event, but can be run at any time. The body is removed from the simulator and replaced with one or more shards. Returns an int array of the body IDs of all resulting shards. The optional collider ID is the body used for localized breaking.


fxCmd hasFracture [fxWorld node] <fracture logical-index>

Return non-zero if a fracture node is connected to the simulator at the given element of in_fxFracture


fxCmd hasBody [fxWorld node] <body ID>

Return non-zero if a body with the given ID still exists in the simulation. When a body is fractured it is removed from the simulation and replaced with one or more shards, each with their own ID


fxCmd hasAttr [fxWorld node] <body ID> <name>

Return non-zero if custom data of the given name exists on the given rigid body


fxCmd getAttr [fxWorld node] <body ID> <name>

Return the value of named custom data on a rigid body. If the data doesn't exist 0 is returned. You can distinguish between non-existing data, and existing data with the value 0, using the hasAttr call.


fxCmd setAttr [fxworld node] <body ID> <name> <type> <value>

Set named custom data on a body. Type is one of: bool/int/float/vector/string. Overwrites any existing data on that body with the same name.


fxCmd addParams <node>

Add attributes to a shape node to hold dynamics parameters. Rigid bodies derived from this node will inherit the dynamics parameters


fxCmd listFilterTypes

List all available filter types supported by the plug-in.


fxCmd listCustomData <node>

Return a string array listing the names and types of custom data on the given shape node. Name/type pairs are interleaved in the returned array. The values of those attributes will be copied to custom data on when a rigid body is created from that shape node. Attributes on the node are prefixed with "fxAttr".


fxCmd contactQuery [fxWorld node] <-count | -pairs | -unique_pairs -bodies>

To be used in the script of a collision event. Returns info about the bodies that passed all the filters for the event.

-count : The number of pairs of colliding bodies that passed all filters
-pairs : Returns an int array containing pairs of IDs of the colliding bodies which passed all filters. The size of the resulting array is always even, since it holds pairs of body IDs. One body may appear in the list multiple times (ie. in multiple pairs), since it could have collided with more than one other body.
-unique_pairs : The same as -pairs, but with the constraint that each body (other than the ground plane) will appear at most once in the entire list; this means that not all colliding pairs are listed. Used to avoid a call to fracture_body more than once per body when that body is involved in multiple collisions during one time step.
-bodies : Returns the IDs of colliding bodies across all pairs. The returned int array is a unique list of bodies involved in any number of collisions. Each body appears in the list exactly once.


fxCmd bakeToKeys <take log idx> <simulator node>

Bake the simulation to keyframes, overwriting the take at the given index


fxCmd clearTake <take log idx> <simulator node>

Remove all animcurves on all input objects and shards for the given take.

fxCmd replaceWithKeys <take log idx> <simulator node>

Remove the simulator, break-geo nodes, and reconnect all animcurves for the take at the given index into the corresponding transform nodes.


fxCmd modify {intArray of body IDs} [opp body ID]

Run the given rigid bodies through the modifier list for the current event. Callable from the script of collide and anim events. Optionally pass the ID of the opposing body in a collision pair, for modifiers that support it.


fxCmd animQuery [-bodies]

Return the IDs of rigid bodies that passed the filter list of an animEvent. Should be used in the script of an animEvent.


fxCmd setInitialState [nodes ...]

If no args are specified, set the initial state for selected objects; otherwise assume all string args are the names of nodes to set the state for.


fxCmd listUniqueCustomData {nodes}

Return an interleaved array of the names and types of all custom data used across the nodes in the input string array. Data with the same name on several nodes appears once.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox