| appendix |
| script bbConnect |
Synopsis
int bbConnect(string $sourceNode,
string $destinationNode,int $index)
ReturnValue
1 if operation successfuly, 0 else
Description
This command greatly simplifies the setup process for bRAINbUGZ. The table shows
all possible combinations of source and destination nodes and actions taken
by the script.
| Source Node | Destination Node | Action |
| particle | bbSteeringDesire | connectAttr particle.fieldData bbSD.inputData[0]; |
| field | connectAttr particle.fieldData field.inputData[0]; | |
| bbSteeringDesire | particle | connectAttr bbSD.outputForce[0] particle.inputForce[index]; |
| bbCombineForces | connectAttr
bbSD.outputForce[0] bbCF.inputForces[index]; connectAttr bbSD.priority bbCF.inputPriorities[index]; connectAttr bbSD.weight bbCF.inputWeights[index]; |
|
| field | particle | connectAttr field.outputForce[0] particle.inputForce[index]; |
| bbCombineForces |
select field; |
|
| bbCombineForces | particle | connectAttr bbCF.outputForce particle.inputForce[index]; |
| bbCombineForces | connectAttr
bbCF.outputForce bbCF2.inputForces[index]; connectAttr bbCF.priority bbCF2.inputPriorities[index]; connectAttr bbCF.weight bbCF2.inputWeights[index]; |
|
| locator | bbSteeringDesire | connectAttr locator.worldPosition bbSD.inputPoint[index]; |
| nurbsCurve | bbSteeringDesire | connectAttr curve.worldSpace bbSD.inputCurve[index]; |
| nurbsSurface | bbSteeringDesire | connectAttr surface.worldSpace bbSD.inputSurface[index]; |
Arguments
string $sourceNode -
node from which should be connected
string $destinationNode
- node to which should be connected
int $index - index of
destination nodes array attribute, if -1 connecting to next available
Examples
Create particle node particleShape1, then enter this:
createNode bbSteeringDesire
-n bbSD_1;
createNode bbSteeringDesire -n bbSD_2;
createNode bbCombineForces -n bbCF;
// Connect particles with steering desires
bbConnect particleShape1 bbSD_1
0;
bbConnect particleShape1 bbSD_2
0;
// Connect steering desires with force combiner
bbConnect bbSD_1 bbCF 0;
bbConnect bbSD_2 bbCF 1;
// Connect force combiner with particles
bbConnect bbCF particleShape1;
Notes
It is recommended to always use an specific index, so you are sure how nodes
are connected.