Crash bug when "mesh" applied twice fixed

Constraints reworked - all of them could now work with one or two bodies

Modification of constraint frames and initial positions of rigid bodies
now allowed at start frame only

Plugin version is set to 2.76
This commit is contained in:
rponom
2010-01-23 03:15:43 +00:00
parent 5e85d43b0b
commit e459145b91
49 changed files with 3293 additions and 756 deletions

Binary file not shown.

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//bt_rigid_body.h //bt_rigid_body.h
@@ -60,6 +59,17 @@ public:
btTransform xform(btQuaternion(tr[1], tr[2], tr[3], tr[0]), btTransform xform(btQuaternion(tr[1], tr[2], tr[3], tr[0]),
btVector3(tp[0], tp[1], tp[2])); btVector3(tp[0], tp[1], tp[2]));
m_body->setWorldTransform(xform); m_body->setWorldTransform(xform);
// static bodies may got false "impulse" when editing in Maya, so...
m_body->setInterpolationWorldTransform(xform);
}
virtual void set_interpolation_transform(vec3f const &position, quatf const &rotation)
{
vec3f tp = position;
quatf tr = rotation;
btTransform xform(btQuaternion(tr[1], tr[2], tr[3], tr[0]),
btVector3(tp[0], tp[1], tp[2]));
m_body->setInterpolationWorldTransform(xform);
} }
virtual void set_kinematic(bool kinematic) virtual void set_kinematic(bool kinematic)

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//bt_solver.cpp //bt_solver.cpp
@@ -60,7 +63,7 @@ bt_solver_t::bt_solver_t():
//register algorithm for concave meshes //register algorithm for concave meshes
btGImpactCollisionAlgorithm::registerAlgorithm(m_dispatcher.get()); btGImpactCollisionAlgorithm::registerAlgorithm(m_dispatcher.get());
m_dynamicsWorld->setGravity(btVector3(0, -9.81, 0)); m_dynamicsWorld->setGravity(btVector3(0, -9.81f, 0));
// m_dynamicsWorld->getSolverInfo().m_splitImpulse = true; // m_dynamicsWorld->getSolverInfo().m_splitImpulse = true;
} }

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//bt_solver.h //bt_solver.h
@@ -83,21 +82,33 @@ public:
{ {
return new bt_nail_constraint_t(rb, pivot); return new bt_nail_constraint_t(rb, pivot);
} }
virtual nail_constraint_impl_t* create_nail_constraint(rigid_body_impl_t* rbA, rigid_body_impl_t* rbB, vec3f const& pivot) virtual nail_constraint_impl_t* create_nail_constraint(rigid_body_impl_t* rbA, rigid_body_impl_t* rbB, vec3f const& pivotInA, vec3f const& pivotInB)
{ {
return new bt_nail_constraint_t(rbA, rbB, pivot); return new bt_nail_constraint_t(rbA, rbB, pivotInA, pivotInB);
} }
virtual hinge_constraint_impl_t* create_hinge_constraint(rigid_body_impl_t* rb, vec3f const& pivot) virtual hinge_constraint_impl_t* create_hinge_constraint(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot)
{ {
return new bt_hinge_constraint_t(rb, pivot); return new bt_hinge_constraint_t(rb, pivot, rot);
} }
virtual slider_constraint_impl_t* create_slider_constraint(rigid_body_impl_t* rbA, vec3f const& pivotA, rigid_body_impl_t* rbB, vec3f const& pivotB) virtual hinge_constraint_impl_t* create_hinge_constraint(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB)
{ {
return new bt_slider_constraint_t(rbA, pivotA, rbB, pivotB); return new bt_hinge_constraint_t(rbA, pivotA, rotA, rbB, pivotB, rotB);
} }
virtual sixdof_constraint_impl_t* create_sixdof_constraint(rigid_body_impl_t* rbA, vec3f const& pivotA, rigid_body_impl_t* rbB, vec3f const& pivotB) virtual slider_constraint_impl_t* create_slider_constraint(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot)
{ {
return new bt_sixdof_constraint_t(rbA, pivotA, rbB, pivotB); return new bt_slider_constraint_t(rb, pivot, rot);
}
virtual slider_constraint_impl_t* create_slider_constraint(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB)
{
return new bt_slider_constraint_t(rbA, pivotA, rotA, rbB, pivotB, rotB);
}
virtual sixdof_constraint_impl_t* create_sixdof_constraint(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot)
{
return new bt_sixdof_constraint_t(rb, pivot, rot);
}
virtual sixdof_constraint_impl_t* create_sixdof_constraint(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB)
{
return new bt_sixdof_constraint_t(rbA, pivotA, rotA, rbB, pivotB, rotB);
} }
virtual void add_rigid_body(rigid_body_impl_t* rb) virtual void add_rigid_body(rigid_body_impl_t* rb)

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//bt_constraint.h //bt_constraint.h

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//bt_hinge_constraint.h //bt_hinge_constraint.h
@@ -29,6 +28,7 @@ Modified by Roman Ponomarev <rponom@gmail.com>
#ifndef DYN_BT_HINGE_CONSTRAINT_H #ifndef DYN_BT_HINGE_CONSTRAINT_H
#define DYN_BT_HINGE_CONSTRAINT_H #define DYN_BT_HINGE_CONSTRAINT_H
#include "bt_rigid_body.h"
#include "bt_constraint.h" #include "bt_constraint.h"
#include "hinge_constraint_impl.h" #include "hinge_constraint_impl.h"
@@ -58,42 +58,77 @@ public:
} }
// //
virtual void set_pivot(vec3f const &p) { virtual void get_frameA(vec3f& p, quatf& r) const
/* btHingeConstraint* p2pc = static_cast<btHingeConstraint*>(m_constraint.get()); {
btVector3 bt_pivot(p[0], p[1], p[2]); btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
p2pc->setPivotA(bt_pivot); const btTransform& btxform = hc->getAFrame();
p2pc->setPivotB(m_constraint->getRigidBodyA().getCenterOfMassTransform()(bt_pivot)); btQuaternion bq = btxform.getRotation();
// p2pc->buildJacobian(); btVector3 bp = btxform.getOrigin();
*/ } p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
virtual void get_pivot(vec3f &p) const { }
/* btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get()); virtual void get_frameB(vec3f& p, quatf& r) const
p[0] = hc->getPivotInA().x(); {
p[1] = hc->getPivotInA().y(); btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
p[2] = hc->getPivotInA().z(); const btTransform& btxform = hc->getBFrame();
*/ } btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
virtual void get_world_pivot(vec3f &p) const { p = vec3f(bp.x(), bp.y(), bp.z());
/* btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get()); r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
p[0] = hc->getPivotInB().x(); }
p[1] = hc->getPivotInB().y(); virtual void get_invFrameA(vec3f& p, quatf& r) const
p[2] = hc->getPivotInB().z(); {
*/ } btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
const btTransform btxform = hc->getAFrame().inverse();
virtual void set_world(vec3f const &p) { btQuaternion bq = btxform.getRotation();
btHingeConstraint* hc = static_cast<btHingeConstraint*>(m_constraint.get()); btVector3 bp = btxform.getOrigin();
btVector3 world(p[0], p[1], p[2]); p = vec3f(bp.x(), bp.y(), bp.z());
btVector3 pivotA = hc->getRigidBodyA().getWorldTransform().inverse() (world); r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
hc->getAFrame().getOrigin() = pivotA; }
hc->getBFrame().getOrigin() = world; virtual void get_invFrameB(vec3f& p, quatf& r) const
// p2pc->buildJacobian(); {
btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
const btTransform btxform = hc->getBFrame().inverse();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void worldToA(vec3f& w, vec3f& p) const
{
btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
const btTransform w2a = (hc->getRigidBodyA().getWorldTransform() * hc->getAFrame()).inverse();
btVector3 bw(w[0], w[1], w[2]);
btVector3 bp = w2a * bw;
p = vec3f(bp[0], bp[1], bp[2]);
}
virtual void worldFromB(vec3f& p, vec3f& w) const
{
btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
const btTransform b2w = hc->getRigidBodyB().getWorldTransform() * hc->getBFrame();
btVector3 bp(p[0], p[1], p[2]);
btVector3 bw = b2w * bp;
w = vec3f(bw[0], bw[1], bw[2]);
} }
virtual void get_world(vec3f &p) const { virtual void set_world(vec3f const &p, quatf const& r) {
btHingeConstraint* hc = static_cast<btHingeConstraint*>(m_constraint.get());
btVector3 worldP(p[0], p[1], p[2]);
btQuaternion worldR(r[1], r[2], r[3], r[0]);
btTransform frameAinW(worldR, worldP);
btTransform frameA = hc->getRigidBodyA().getWorldTransform().inverse() * frameAinW;
btTransform frameB = hc->getRigidBodyB().getWorldTransform().inverse() * frameAinW;
hc->getAFrame() = frameA;
hc->getBFrame() = frameB;
}
virtual void get_world(vec3f &p, quatf& r) const {
btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get()); btHingeConstraint const* hc = static_cast<btHingeConstraint const*>(m_constraint.get());
p[0] = hc->getBFrame().getOrigin().x(); btTransform frameAinW = hc->getRigidBodyA().getWorldTransform() * hc->getAFrame();
p[1] = hc->getBFrame().getOrigin().y(); btQuaternion bq = frameAinW.getRotation();
p[2] = hc->getBFrame().getOrigin().z(); btVector3 bp = frameAinW.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
} }
virtual void enable_motor(bool enable, float velocity, float impulse) { virtual void enable_motor(bool enable, float velocity, float impulse) {
@@ -104,23 +139,52 @@ public:
virtual void update_constraint(rigid_body_impl_t* rb) virtual void update_constraint(rigid_body_impl_t* rb)
{ {
btHingeConstraint* hc = static_cast<btHingeConstraint*>(m_constraint.get()); btHingeConstraint* hc = static_cast<btHingeConstraint*>(m_constraint.get());
btVector3 world = hc->getBFrame().getOrigin(); btRigidBody* bt_body = static_cast<bt_rigid_body_t*>(rb)->body();
btVector3 pivotA = hc->getRigidBodyA().getWorldTransform().inverse() (world); btTransform frameW, frameL;
hc->getAFrame().getOrigin() = pivotA; if(bt_body == &hc->getRigidBodyA())
{
frameW = hc->getRigidBodyB().getWorldTransform() * hc->getBFrame();
frameL = hc->getRigidBodyA().getWorldTransform().inverse() * frameW;
hc->getAFrame() = frameL;
}
else if(bt_body == &hc->getRigidBodyB())
{
frameW = hc->getRigidBodyA().getWorldTransform() * hc->getAFrame();
frameL = hc->getRigidBodyB().getWorldTransform().inverse() * frameW;
hc->getBFrame() = frameL;
}
setPivotChanged(true);
} }
protected: protected:
friend class bt_solver_t; friend class bt_solver_t;
bt_hinge_constraint_t(rigid_body_impl_t* rb, vec3f const& pivot): bt_hinge_constraint_t(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot):
hinge_constraint_impl_t() hinge_constraint_impl_t()
{ {
btRigidBody& bt_body = *static_cast<bt_rigid_body_t*>(rb)->body(); btRigidBody& bt_body = *static_cast<bt_rigid_body_t*>(rb)->body();
btVector3 pivotA = bt_body.getCenterOfMassPosition(); btVector3 p(pivot[0], pivot[1], pivot[2]);
btVector3 btAxisA( 0.0f, 1.0f, 0.0f ); // pointing upwards, aka Y-axis btQuaternion q(rot[1], rot[2], rot[3], rot[0]);
btHingeConstraint * hinge = new btHingeConstraint(bt_body, -pivotA, btAxisA); btTransform frameInA(q, p);
btHingeConstraint* hinge = new btHingeConstraint(bt_body, frameInA, false);
m_constraint.reset(hinge); m_constraint.reset(hinge);
rb->add_constraint(this); rb->add_constraint(this);
} }
bt_hinge_constraint_t(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB):
hinge_constraint_impl_t()
{
btRigidBody& bt_bodyA = *static_cast<bt_rigid_body_t*>(rbA)->body();
btRigidBody& bt_bodyB = *static_cast<bt_rigid_body_t*>(rbB)->body();
btVector3 pA(pivotA[0], pivotA[1], pivotA[2]);
btQuaternion qA(rotA[1], rotA[2], rotA[3], rotA[0]);
btTransform frameInA(qA, pA);
btVector3 pB(pivotB[0], pivotB[1], pivotB[2]);
btQuaternion qB(rotB[1], rotB[2], rotB[3], rotB[0]);
btTransform frameInB(qB, pB);
btHingeConstraint* hinge = new btHingeConstraint(bt_bodyA, bt_bodyB, frameInA, frameInB, false);
m_constraint.reset(hinge);
rbA->add_constraint(this);
rbB->add_constraint(this);
}
private: private:

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//bt_nail_constraint.h //bt_nail_constraint.h
@@ -29,6 +28,7 @@ Modified by Roman Ponomarev <rponom@gmail.com>
#ifndef DYN_BT_NAIL_CONSTRAINT_H #ifndef DYN_BT_NAIL_CONSTRAINT_H
#define DYN_BT_NAIL_CONSTRAINT_H #define DYN_BT_NAIL_CONSTRAINT_H
#include "bt_rigid_body.h"
#include "bt_constraint.h" #include "bt_constraint.h"
#include "nail_constraint_impl.h" #include "nail_constraint_impl.h"
@@ -50,8 +50,7 @@ public:
btPoint2PointConstraint* p2pc = static_cast<btPoint2PointConstraint*>(m_constraint.get()); btPoint2PointConstraint* p2pc = static_cast<btPoint2PointConstraint*>(m_constraint.get());
btVector3 bt_pivot(p[0], p[1], p[2]); btVector3 bt_pivot(p[0], p[1], p[2]);
p2pc->setPivotA(bt_pivot); p2pc->setPivotA(bt_pivot);
p2pc->setPivotB(m_constraint->getRigidBodyA().getCenterOfMassTransform()(bt_pivot)); setPivotChanged(true);
// p2pc->buildJacobian();
} }
virtual void get_pivotA(vec3f &p) const { virtual void get_pivotA(vec3f &p) const {
@@ -61,17 +60,34 @@ public:
p[2] = p2pc->getPivotInA().z(); p[2] = p2pc->getPivotInA().z();
} }
virtual void get_world_pivot(vec3f &p) const { virtual void set_pivotB(vec3f const &p) {
// btPoint2PointConstraint const* p2pc = static_cast<btPoint2PointConstraint const*>(m_constraint.get()); btPoint2PointConstraint* p2pc = static_cast<btPoint2PointConstraint*>(m_constraint.get());
// p[0] = p2pc->getPivotInB().x(); btVector3 bt_pivot(p[0], p[1], p[2]);
// p[1] = p2pc->getPivotInB().y(); p2pc->setPivotB(bt_pivot);
// p[2] = p2pc->getPivotInB().z(); setPivotChanged(true);
}
virtual void get_pivotB(vec3f &p) const {
btPoint2PointConstraint const* p2pc = static_cast<btPoint2PointConstraint const*>(m_constraint.get());
p[0] = p2pc->getPivotInB().x();
p[1] = p2pc->getPivotInB().y();
p[2] = p2pc->getPivotInB().z();
}
virtual void get_world_pivotA(vec3f &p) const {
btPoint2PointConstraint const* p2pc = static_cast<btPoint2PointConstraint const*>(m_constraint.get()); btPoint2PointConstraint const* p2pc = static_cast<btPoint2PointConstraint const*>(m_constraint.get());
btVector3 pivotAinW = p2pc->getRigidBodyA().getCenterOfMassTransform()* p2pc->getPivotInA(); btVector3 pivotAinW = p2pc->getRigidBodyA().getCenterOfMassTransform()* p2pc->getPivotInA();
p[0] = pivotAinW.x(); p[0] = pivotAinW.x();
p[1] = pivotAinW.y(); p[1] = pivotAinW.y();
p[2] = pivotAinW.z(); p[2] = pivotAinW.z();
} }
virtual void get_world_pivotB(vec3f &p) const {
btPoint2PointConstraint const* p2pc = static_cast<btPoint2PointConstraint const*>(m_constraint.get());
btVector3 pivotBinW = p2pc->getRigidBodyB().getCenterOfMassTransform()* p2pc->getPivotInB();
p[0] = pivotBinW.x();
p[1] = pivotBinW.y();
p[2] = pivotBinW.z();
}
virtual void set_world(vec3f const &p) { virtual void set_world(vec3f const &p) {
btPoint2PointConstraint* p2pc = static_cast<btPoint2PointConstraint*>(m_constraint.get()); btPoint2PointConstraint* p2pc = static_cast<btPoint2PointConstraint*>(m_constraint.get());
@@ -80,15 +96,12 @@ public:
p2pc->setPivotA(pivotA); p2pc->setPivotA(pivotA);
btVector3 pivotB = p2pc->getRigidBodyB().getWorldTransform().inverse() (world); btVector3 pivotB = p2pc->getRigidBodyB().getWorldTransform().inverse() (world);
p2pc->setPivotB(pivotB); p2pc->setPivotB(pivotB);
// p2pc->buildJacobian(); setPivotChanged(true);
} }
virtual void get_world(vec3f &p) const { virtual void get_world(vec3f &p) const {
btPoint2PointConstraint const* p2pc = static_cast<btPoint2PointConstraint const*>(m_constraint.get()); btPoint2PointConstraint const* p2pc = static_cast<btPoint2PointConstraint const*>(m_constraint.get());
btVector3 pivotAinW = p2pc->getRigidBodyA().getCenterOfMassTransform()* p2pc->getPivotInA(); btVector3 pivotAinW = p2pc->getRigidBodyA().getCenterOfMassTransform()* p2pc->getPivotInA();
// p[0] = p2pc->getPivotInB().x();
// p[1] = p2pc->getPivotInB().y();
// p[2] = p2pc->getPivotInB().z();
p[0] = pivotAinW.x(); p[0] = pivotAinW.x();
p[1] = pivotAinW.y(); p[1] = pivotAinW.y();
p[2] = pivotAinW.z(); p[2] = pivotAinW.z();
@@ -115,10 +128,7 @@ public:
{ {
world.setValue(0.f, 0.f, 0.f); world.setValue(0.f, 0.f, 0.f);
} }
setPivotChanged(true);
// btVector3 world = p2pc->getPivotInB();
// btVector3 pivotA = p2pc->getRigidBodyA().getWorldTransform().inverse() (world);
// p2pc->setPivotA(pivotA);
} }
protected: protected:
friend class bt_solver_t; friend class bt_solver_t;
@@ -126,30 +136,19 @@ protected:
bt_nail_constraint_t(rigid_body_impl_t* rb, vec3f const& pivot): bt_nail_constraint_t(rigid_body_impl_t* rb, vec3f const& pivot):
nail_constraint_impl_t() nail_constraint_impl_t()
{ {
btVector3 pivotW(pivot[0], pivot[1], pivot[2]); btVector3 bulPivot(pivot[0], pivot[1], pivot[2]);
btRigidBody& bt_body = *static_cast<bt_rigid_body_t*>(rb)->body(); btRigidBody& bt_body = *static_cast<bt_rigid_body_t*>(rb)->body();
const btTransform& tr = bt_body.getCenterOfMassTransform(); m_constraint.reset(new btPoint2PointConstraint(bt_body, bulPivot));
btTransform iTr = tr.inverse();
btVector3 nPivot = iTr * pivotW;
m_constraint.reset(new btPoint2PointConstraint(bt_body, nPivot));
// btVector3 pivotA = bt_body.getCenterOfMassPosition();
// m_constraint.reset(new btPoint2PointConstraint(bt_body, -pivotA));
rb->add_constraint(this); rb->add_constraint(this);
} }
bt_nail_constraint_t(rigid_body_impl_t* rbA, rigid_body_impl_t* rbB, vec3f const& pivotInA, vec3f const& pivotInB):
bt_nail_constraint_t(rigid_body_impl_t* rbA, rigid_body_impl_t* rbB, vec3f const& pivot):
nail_constraint_impl_t() nail_constraint_impl_t()
{ {
btVector3 pivotW(pivot[0], pivot[1], pivot[2]);
btRigidBody& bt_bodyA = *static_cast<bt_rigid_body_t*>(rbA)->body(); btRigidBody& bt_bodyA = *static_cast<bt_rigid_body_t*>(rbA)->body();
const btTransform& trA = bt_bodyA.getCenterOfMassTransform();
btTransform iTrA = trA.inverse();
btVector3 nPivotA = iTrA * pivotW;
btRigidBody& bt_bodyB = *static_cast<bt_rigid_body_t*>(rbB)->body(); btRigidBody& bt_bodyB = *static_cast<bt_rigid_body_t*>(rbB)->body();
const btTransform& trB = bt_bodyB.getCenterOfMassTransform(); btVector3 bulPivotInA(pivotInA[0], pivotInA[1], pivotInA[2]);
btTransform iTrB = trB.inverse(); btVector3 bulPivotInB(pivotInB[0], pivotInB[1], pivotInB[2]);
btVector3 nPivotB = iTrB * pivotW; m_constraint.reset(new btPoint2PointConstraint(bt_bodyA, bt_bodyB, bulPivotInA, bulPivotInB));
m_constraint.reset(new btPoint2PointConstraint(bt_bodyA, bt_bodyB, nPivotA, nPivotB));
rbA->add_constraint(this); rbA->add_constraint(this);
rbB->add_constraint(this); rbB->add_constraint(this);
} }

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//bt_sixdof_constraint.h //bt_sixdof_constraint.h
@@ -29,6 +28,7 @@ Modified by Roman Ponomarev <rponom@gmail.com>
#ifndef DYN_BT_SIXDOF_CONSTRAINT_H #ifndef DYN_BT_SIXDOF_CONSTRAINT_H
#define DYN_BT_SIXDOF_CONSTRAINT_H #define DYN_BT_SIXDOF_CONSTRAINT_H
#include "bt_rigid_body.h"
#include "bt_constraint.h" #include "bt_constraint.h"
#include "sixdof_constraint_impl.h" #include "sixdof_constraint_impl.h"
@@ -40,16 +40,20 @@ public:
// p2pc->m_setting.m_damping = d; // p2pc->m_setting.m_damping = d;
} }
virtual void set_LinLimit(float lower, float upper) { virtual void set_LinLimit(vec3f& lower, vec3f& upper) {
btGeneric6DofConstraint* sixdof = static_cast<btGeneric6DofConstraint*>(m_constraint.get()); btGeneric6DofConstraint* sixdof = static_cast<btGeneric6DofConstraint*>(m_constraint.get());
// sixdof->setLowerLinLimit(lower); btVector3 btlow(lower[0], lower[1], lower[2]);
// sixdof->setUpperLinLimit(upper); btVector3 btupp(upper[0], upper[1], upper[2]);
sixdof->setLinearLowerLimit(btlow);
sixdof->setLinearUpperLimit(btupp);
} }
virtual void set_AngLimit(float lower, float upper) { virtual void set_AngLimit(vec3f& lower, vec3f& upper) {
btGeneric6DofConstraint* sixdof = static_cast<btGeneric6DofConstraint*>(m_constraint.get()); btGeneric6DofConstraint* sixdof = static_cast<btGeneric6DofConstraint*>(m_constraint.get());
// sixdof->setLowerAngLimit(lower); btVector3 btlow(lower[0], lower[1], lower[2]);
// sixdof->setUpperAngLimit(upper); btVector3 btupp(upper[0], upper[1], upper[2]);
sixdof->setAngularLowerLimit(btlow);
sixdof->setAngularUpperLimit(btupp);
} }
virtual float damping() const { virtual float damping() const {
@@ -58,66 +62,130 @@ public:
return 0; return 0;
} }
// virtual void get_frameA(vec3f& p, quatf& r) const
virtual void set_pivot(vec3f const &p) { {
/* btGeneric6DofConstraint* p2pc = static_cast<btGeneric6DofConstraint*>(m_constraint.get()); btGeneric6DofConstraint const* sc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
btVector3 bt_pivot(p[0], p[1], p[2]); const btTransform& btxform = sc->getFrameOffsetA();
p2pc->setPivotA(bt_pivot); btQuaternion bq = btxform.getRotation();
p2pc->setPivotB(m_constraint->getRigidBodyA().getCenterOfMassTransform()(bt_pivot)); btVector3 bp = btxform.getOrigin();
// p2pc->buildJacobian(); p = vec3f(bp.x(), bp.y(), bp.z());
*/ } r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void get_pivot(vec3f &p) const { virtual void get_frameB(vec3f& p, quatf& r) const
/* btGeneric6DofConstraint const* hc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get()); {
p[0] = hc->getPivotInA().x(); btGeneric6DofConstraint const* sc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
p[1] = hc->getPivotInA().y(); const btTransform& btxform = sc->getFrameOffsetB();
p[2] = hc->getPivotInA().z(); btQuaternion bq = btxform.getRotation();
*/ } btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
virtual void get_world_pivot(vec3f &p) const { r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
/* btGeneric6DofConstraint const* hc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get()); }
p[0] = hc->getPivotInB().x(); virtual void get_invFrameA(vec3f& p, quatf& r) const
p[1] = hc->getPivotInB().y(); {
p[2] = hc->getPivotInB().z(); btGeneric6DofConstraint const* sc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
*/ } const btTransform btxform = sc->getFrameOffsetA().inverse();
btQuaternion bq = btxform.getRotation();
virtual void set_world(vec3f const &p) { btVector3 bp = btxform.getOrigin();
btGeneric6DofConstraint* constraint = static_cast<btGeneric6DofConstraint*>(m_constraint.get()); p = vec3f(bp.x(), bp.y(), bp.z());
btTransform framInA = constraint->getRigidBodyA().getCenterOfMassTransform().inverse(); r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
btTransform framInB = constraint->getRigidBodyB().getCenterOfMassTransform().inverse(); }
constraint->getFrameOffsetA() = framInA; virtual void get_invFrameB(vec3f& p, quatf& r) const
constraint->getFrameOffsetB() = framInB; {
world = p; btGeneric6DofConstraint const* sc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
const btTransform btxform = sc->getFrameOffsetB().inverse();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void worldToA(vec3f& w, vec3f& p) const
{
btGeneric6DofConstraint const* sc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
const btTransform w2a = (sc->getRigidBodyA().getWorldTransform() * sc->getFrameOffsetA()).inverse();
btVector3 bw(w[0], w[1], w[2]);
btVector3 bp = w2a * bw;
p = vec3f(bp[0], bp[1], bp[2]);
}
virtual void worldFromB(vec3f& p, vec3f& w) const
{
btGeneric6DofConstraint const* sc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
const btTransform b2w = sc->getRigidBodyB().getWorldTransform() * sc->getFrameOffsetB();
btVector3 bp(p[0], p[1], p[2]);
btVector3 bw = b2w * bp;
w = vec3f(bw[0], bw[1], bw[2]);
} }
virtual void get_world(vec3f &p) const { virtual void set_world(vec3f const &p, quatf const& r) {
/* btGeneric6DofConstraint const* hc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get()); btGeneric6DofConstraint* sc = static_cast<btGeneric6DofConstraint*>(m_constraint.get());
p[0] = hc->getFrameOffsetB().getOrigin().x(); btVector3 worldP(p[0], p[1], p[2]);
p[1] = hc->getFrameOffsetB().getOrigin().y(); btQuaternion worldR(r[1], r[2], r[3], r[0]);
p[2] = hc->getFrameOffsetB().getOrigin().z(); btTransform frameAinW(worldR, worldP);
*/ p = world; btTransform frameA = sc->getRigidBodyA().getWorldTransform().inverse() * frameAinW;
btTransform frameB = sc->getRigidBodyB().getWorldTransform().inverse() * frameAinW;
sc->getFrameOffsetA() = frameA;
sc->getFrameOffsetB() = frameB;
}
virtual void get_world(vec3f &p, quatf& r) const {
btGeneric6DofConstraint const* sc = static_cast<btGeneric6DofConstraint const*>(m_constraint.get());
btTransform frameAinW = sc->getRigidBodyA().getWorldTransform() * sc->getFrameOffsetA();
btQuaternion bq = frameAinW.getRotation();
btVector3 bp = frameAinW.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
} }
virtual void update_constraint(rigid_body_impl_t* rb) virtual void update_constraint(rigid_body_impl_t* rb)
{ {
btGeneric6DofConstraint* constraint = static_cast<btGeneric6DofConstraint*>(m_constraint.get()); btGeneric6DofConstraint* sc = static_cast<btGeneric6DofConstraint*>(m_constraint.get());
constraint->getFrameOffsetA() = constraint->getRigidBodyA().getCenterOfMassTransform().inverse(); btRigidBody* bt_body = static_cast<bt_rigid_body_t*>(rb)->body();
constraint->getFrameOffsetB() = constraint->getRigidBodyB().getCenterOfMassTransform().inverse(); btTransform frameW, frameL;
if(bt_body == &sc->getRigidBodyA())
{
frameW = sc->getRigidBodyB().getWorldTransform() * sc->getFrameOffsetB();
frameL = sc->getRigidBodyA().getWorldTransform().inverse() * frameW;
sc->getFrameOffsetA() = frameL;
} }
else if(bt_body == &sc->getRigidBodyB())
{
frameW = sc->getRigidBodyA().getWorldTransform() * sc->getFrameOffsetA();
frameL = sc->getRigidBodyB().getWorldTransform().inverse() * frameW;
sc->getFrameOffsetB() = frameL;
}
setPivotChanged(true);
}
protected: protected:
friend class bt_solver_t; friend class bt_solver_t;
vec3f world;
bt_sixdof_constraint_t(rigid_body_impl_t* rbA, vec3f const& pivotA, rigid_body_impl_t* rbB, vec3f const& pivotB): bt_sixdof_constraint_t(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot):
sixdof_constraint_impl_t()
{
btRigidBody& bt_body = *static_cast<bt_rigid_body_t*>(rb)->body();
btVector3 p(pivot[0], pivot[1], pivot[2]);
btQuaternion q(rot[1], rot[2], rot[3], rot[0]);
btTransform frameInA(q, p);
btGeneric6DofConstraint* sixdof = new btGeneric6DofConstraint(bt_body, frameInA, false);
m_constraint.reset(sixdof);
rb->add_constraint(this);
}
bt_sixdof_constraint_t(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB):
sixdof_constraint_impl_t() sixdof_constraint_impl_t()
{ {
btRigidBody& bt_bodyA = *static_cast<bt_rigid_body_t*>(rbA)->body(); btRigidBody& bt_bodyA = *static_cast<bt_rigid_body_t*>(rbA)->body();
btRigidBody& bt_bodyB = *static_cast<bt_rigid_body_t*>(rbB)->body(); btRigidBody& bt_bodyB = *static_cast<bt_rigid_body_t*>(rbB)->body();
btTransform framInA = bt_bodyA.getCenterOfMassTransform().inverse(); btVector3 pA(pivotA[0], pivotA[1], pivotA[2]);
btTransform framInB = bt_bodyB.getCenterOfMassTransform().inverse(); btQuaternion qA(rotA[1], rotA[2], rotA[3], rotA[0]);
btGeneric6DofConstraint * sixdof = new btGeneric6DofConstraint(bt_bodyA, bt_bodyB, framInA, framInB, true); btTransform frameInA(qA, pA);
btVector3 pB(pivotB[0], pivotB[1], pivotB[2]);
btQuaternion qB(rotB[1], rotB[2], rotB[3], rotB[0]);
btTransform frameInB(qB, pB);
btGeneric6DofConstraint* sixdof = new btGeneric6DofConstraint(bt_bodyA, bt_bodyB, frameInA, frameInB, false);
m_constraint.reset(sixdof); m_constraint.reset(sixdof);
rbA->add_constraint(this); rbA->add_constraint(this);
rbB->add_constraint(this);
} }
private: private:

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//bt_slider_constraint.h //bt_slider_constraint.h
@@ -29,6 +28,7 @@ Modified by Roman Ponomarev <rponom@gmail.com>
#ifndef DYN_BT_SLIDER_CONSTRAINT_H #ifndef DYN_BT_SLIDER_CONSTRAINT_H
#define DYN_BT_SLIDER_CONSTRAINT_H #define DYN_BT_SLIDER_CONSTRAINT_H
#include "bt_rigid_body.h"
#include "bt_constraint.h" #include "bt_constraint.h"
#include "slider_constraint_impl.h" #include "slider_constraint_impl.h"
@@ -58,71 +58,129 @@ public:
return 0; return 0;
} }
// virtual void get_frameA(vec3f& p, quatf& r) const
virtual void set_pivot(vec3f const &p) { {
/* btSliderConstraint* p2pc = static_cast<btSliderConstraint*>(m_constraint.get()); btSliderConstraint const* sc = static_cast<btSliderConstraint const*>(m_constraint.get());
btVector3 bt_pivot(p[0], p[1], p[2]); const btTransform& btxform = sc->getFrameOffsetA();
p2pc->setPivotA(bt_pivot); btQuaternion bq = btxform.getRotation();
p2pc->setPivotB(m_constraint->getRigidBodyA().getCenterOfMassTransform()(bt_pivot)); btVector3 bp = btxform.getOrigin();
// p2pc->buildJacobian(); p = vec3f(bp.x(), bp.y(), bp.z());
*/ } r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void get_pivot(vec3f &p) const { virtual void get_frameB(vec3f& p, quatf& r) const
/* btSliderConstraint const* hc = static_cast<btSliderConstraint const*>(m_constraint.get()); {
p[0] = hc->getPivotInA().x(); btSliderConstraint const* sc = static_cast<btSliderConstraint const*>(m_constraint.get());
p[1] = hc->getPivotInA().y(); const btTransform& btxform = sc->getFrameOffsetB();
p[2] = hc->getPivotInA().z(); btQuaternion bq = btxform.getRotation();
*/ } btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
virtual void get_world_pivot(vec3f &p) const { r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
/* btSliderConstraint const* hc = static_cast<btSliderConstraint const*>(m_constraint.get()); }
p[0] = hc->getPivotInB().x(); virtual void get_invFrameA(vec3f& p, quatf& r) const
p[1] = hc->getPivotInB().y(); {
p[2] = hc->getPivotInB().z(); btSliderConstraint const* sc = static_cast<btSliderConstraint const*>(m_constraint.get());
*/ } const btTransform btxform = sc->getFrameOffsetA().inverse();
btQuaternion bq = btxform.getRotation();
virtual void set_world(vec3f const &p) { btVector3 bp = btxform.getOrigin();
/* btSliderConstraint* hc = static_cast<btSliderConstraint*>(m_constraint.get()); p = vec3f(bp.x(), bp.y(), bp.z());
btVector3 world(p[0], p[1], p[2]); r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
btVector3 pivotA = hc->getRigidBodyA().getWorldTransform().inverse() (world); }
hc->getFrameOffsetA().getOrigin() = pivotA; virtual void get_invFrameB(vec3f& p, quatf& r) const
hc->getFrameOffsetB().getOrigin() = world; {
*/ // p2pc->buildJacobian(); btSliderConstraint const* sc = static_cast<btSliderConstraint const*>(m_constraint.get());
world = p; const btTransform btxform = sc->getFrameOffsetB().inverse();
btQuaternion bq = btxform.getRotation();
btVector3 bp = btxform.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
}
virtual void worldToA(vec3f& w, vec3f& p) const
{
btSliderConstraint const* sc = static_cast<btSliderConstraint const*>(m_constraint.get());
const btTransform w2a = (sc->getRigidBodyA().getWorldTransform() * sc->getFrameOffsetA()).inverse();
btVector3 bw(w[0], w[1], w[2]);
btVector3 bp = w2a * bw;
p = vec3f(bp[0], bp[1], bp[2]);
}
virtual void worldFromB(vec3f& p, vec3f& w) const
{
btSliderConstraint const* sc = static_cast<btSliderConstraint const*>(m_constraint.get());
const btTransform b2w = sc->getRigidBodyB().getWorldTransform() * sc->getFrameOffsetB();
btVector3 bp(p[0], p[1], p[2]);
btVector3 bw = b2w * bp;
w = vec3f(bw[0], bw[1], bw[2]);
} }
virtual void get_world(vec3f &p) const { virtual void set_world(vec3f const &p, quatf const& r) {
/* btSliderConstraint const* hc = static_cast<btSliderConstraint const*>(m_constraint.get()); btSliderConstraint* sc = static_cast<btSliderConstraint*>(m_constraint.get());
p[0] = hc->getFrameOffsetB().getOrigin().x(); btVector3 worldP(p[0], p[1], p[2]);
p[1] = hc->getFrameOffsetB().getOrigin().y(); btQuaternion worldR(r[1], r[2], r[3], r[0]);
p[2] = hc->getFrameOffsetB().getOrigin().z(); btTransform frameAinW(worldR, worldP);
*/ p = world; btTransform frameA = sc->getRigidBodyA().getWorldTransform().inverse() * frameAinW;
btTransform frameB = sc->getRigidBodyB().getWorldTransform().inverse() * frameAinW;
sc->getFrameOffsetA() = frameA;
sc->getFrameOffsetB() = frameB;
}
virtual void get_world(vec3f &p, quatf& r) const {
btSliderConstraint const* sc = static_cast<btSliderConstraint const*>(m_constraint.get());
btTransform frameAinW = sc->getRigidBodyA().getWorldTransform() * sc->getFrameOffsetA();
btQuaternion bq = frameAinW.getRotation();
btVector3 bp = frameAinW.getOrigin();
p = vec3f(bp.x(), bp.y(), bp.z());
r = quatf(bq.w(), bq.x(), bq.y(), bq.z());
} }
virtual void update_constraint(rigid_body_impl_t* rb) virtual void update_constraint(rigid_body_impl_t* rb)
{ {
/* btRigidBody& bt_bodyA = *static_cast<bt_rigid_body_t*>(rbA)->body(); btSliderConstraint* sc = static_cast<btSliderConstraint*>(m_constraint.get());
btRigidBody& bt_bodyB = *static_cast<bt_rigid_body_t*>(rbB)->body(); btRigidBody* bt_body = static_cast<bt_rigid_body_t*>(rb)->body();
btTransform framInA = btTransform::getIdentity(); btTransform frameW, frameL;
btTransform framInB = btTransform::getIdentity(); if(bt_body == &sc->getRigidBodyA())
btSliderConstraint* slider = static_cast<btSliderConstraint*>(m_constraint.get()); {
slider->getFrameOffsetA(); frameW = sc->getRigidBodyB().getWorldTransform() * sc->getFrameOffsetB();
*/ } frameL = sc->getRigidBodyA().getWorldTransform().inverse() * frameW;
sc->getFrameOffsetA() = frameL;
}
else if(bt_body == &sc->getRigidBodyB())
{
frameW = sc->getRigidBodyA().getWorldTransform() * sc->getFrameOffsetA();
frameL = sc->getRigidBodyB().getWorldTransform().inverse() * frameW;
sc->getFrameOffsetB() = frameL;
}
setPivotChanged(true);
}
protected: protected:
friend class bt_solver_t; friend class bt_solver_t;
vec3f world;
bt_slider_constraint_t(rigid_body_impl_t* rbA, vec3f const& pivotA, rigid_body_impl_t* rbB, vec3f const& pivotB): bt_slider_constraint_t(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot):
slider_constraint_impl_t()
{
btRigidBody& bt_body = *static_cast<bt_rigid_body_t*>(rb)->body();
btVector3 p(pivot[0], pivot[1], pivot[2]);
btQuaternion q(rot[1], rot[2], rot[3], rot[0]);
btTransform frameInA(q, p);
btSliderConstraint* slider = new btSliderConstraint(bt_body, frameInA, false);
m_constraint.reset(slider);
rb->add_constraint(this);
}
bt_slider_constraint_t(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB):
slider_constraint_impl_t() slider_constraint_impl_t()
{ {
btRigidBody& bt_bodyA = *static_cast<bt_rigid_body_t*>(rbA)->body(); btRigidBody& bt_bodyA = *static_cast<bt_rigid_body_t*>(rbA)->body();
btRigidBody& bt_bodyB = *static_cast<bt_rigid_body_t*>(rbB)->body(); btRigidBody& bt_bodyB = *static_cast<bt_rigid_body_t*>(rbB)->body();
btTransform framInA = btTransform::getIdentity(); btVector3 pA(pivotA[0], pivotA[1], pivotA[2]);
btTransform framInB = btTransform::getIdentity(); btQuaternion qA(rotA[1], rotA[2], rotA[3], rotA[0]);
btSliderConstraint * slider = new btSliderConstraint(bt_bodyA, bt_bodyB, framInA, framInB, true); btTransform frameInA(qA, pA);
btVector3 pB(pivotB[0], pivotB[1], pivotB[2]);
btQuaternion qB(rotB[1], rotB[2], rotB[3], rotB[0]);
btTransform frameInB(qB, pB);
btSliderConstraint* slider = new btSliderConstraint(bt_bodyA, bt_bodyB, frameInA, frameInB, false);
m_constraint.reset(slider); m_constraint.reset(slider);
rbA->add_constraint(this); rbA->add_constraint(this);
rbB->add_constraint(this);
} }
private: private:

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//constraint.h //constraint.h
@@ -37,6 +40,18 @@ public:
public: public:
virtual ~constraint_t() {} virtual ~constraint_t() {}
bool getPivotChanged()
{
constraint_impl_t* constr_impl = dynamic_cast<constraint_impl_t*>(impl());
return constr_impl->getPivotChanged();
}
void setPivotChanged(bool isChanged)
{
constraint_impl_t* constr_impl = dynamic_cast<constraint_impl_t*>(impl());
return constr_impl->setPivotChanged(isChanged);
}
constraint_impl_t* pubImpl() { return m_impl.get(); }
protected: protected:
friend class solver_t; friend class solver_t;

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//constraint_impl.h //constraint_impl.h
@@ -32,6 +35,10 @@ public:
public: public:
virtual ~constraint_impl_t() {}; virtual ~constraint_impl_t() {};
bool getPivotChanged() { return m_pivotChanged; }
void setPivotChanged(bool isChanged) { m_pivotChanged = isChanged; }
protected:
bool m_pivotChanged;
}; };
#endif #endif

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//hingeConstraintNode.cpp //hingeConstraintNode.cpp
@@ -39,18 +42,25 @@ Written by: Herbert Law <Herbert.Law@gmail.com>
#include "mayaUtils.h" #include "mayaUtils.h"
#include "solver.h" #include "solver.h"
#include "dSolverNode.h"
#include "constraint/bt_hinge_constraint.h"
MTypeId hingeConstraintNode::typeId(0x10033B); MTypeId hingeConstraintNode::typeId(0x10033B);
MString hingeConstraintNode::typeName("dHingeConstraint"); MString hingeConstraintNode::typeName("dHingeConstraint");
MObject hingeConstraintNode::ia_rigidBody; MObject hingeConstraintNode::ia_rigidBodyA;
MObject hingeConstraintNode::ia_rigidBodyB;
MObject hingeConstraintNode::ia_damping; MObject hingeConstraintNode::ia_damping;
MObject hingeConstraintNode::ia_lowerLimit; MObject hingeConstraintNode::ia_lowerLimit;
MObject hingeConstraintNode::ia_upperLimit; MObject hingeConstraintNode::ia_upperLimit;
MObject hingeConstraintNode::ia_limitSoftness; MObject hingeConstraintNode::ia_limitSoftness;
MObject hingeConstraintNode::ia_biasFactor; MObject hingeConstraintNode::ia_biasFactor;
MObject hingeConstraintNode::ia_relaxationFactor; MObject hingeConstraintNode::ia_relaxationFactor;
MObject hingeConstraintNode::ia_hingeAxis; MObject hingeConstraintNode::ia_rotationInA;
MObject hingeConstraintNode::ia_rotationInB;
MObject hingeConstraintNode::ia_pivotInA;
MObject hingeConstraintNode::ia_pivotInB;
MObject hingeConstraintNode::ia_enableAngularMotor; MObject hingeConstraintNode::ia_enableAngularMotor;
MObject hingeConstraintNode::ia_motorTargetVelocity; MObject hingeConstraintNode::ia_motorTargetVelocity;
@@ -66,10 +76,15 @@ MStatus hingeConstraintNode::initialize()
MFnNumericAttribute fnNumericAttr; MFnNumericAttribute fnNumericAttr;
MFnMatrixAttribute fnMatrixAttr; MFnMatrixAttribute fnMatrixAttr;
ia_rigidBody = fnMsgAttr.create("inRigidBody", "inrb", &status); ia_rigidBodyA = fnMsgAttr.create("inRigidBodyA", "inrba", &status);
MCHECKSTATUS(status, "creating inRigidBody attribute") MCHECKSTATUS(status, "creating inRigidBodyA attribute")
status = addAttribute(ia_rigidBody); status = addAttribute(ia_rigidBodyA);
MCHECKSTATUS(status, "adding inRigidBody attribute") MCHECKSTATUS(status, "adding inRigidBodyA attribute")
ia_rigidBodyB = fnMsgAttr.create("inRigidBodyB", "inrbb", &status);
MCHECKSTATUS(status, "creating inRigidBodyB attribute")
status = addAttribute(ia_rigidBodyB);
MCHECKSTATUS(status, "adding inRigidBodyB attribute")
ia_damping = fnNumericAttr.create("damping", "dmp", MFnNumericData::kDouble, 1.0, &status); ia_damping = fnNumericAttr.create("damping", "dmp", MFnNumericData::kDouble, 1.0, &status);
MCHECKSTATUS(status, "creating damping attribute") MCHECKSTATUS(status, "creating damping attribute")
@@ -77,13 +92,13 @@ MStatus hingeConstraintNode::initialize()
status = addAttribute(ia_damping); status = addAttribute(ia_damping);
MCHECKSTATUS(status, "adding damping attribute") MCHECKSTATUS(status, "adding damping attribute")
ia_lowerLimit = fnNumericAttr.create("lowerLimit", "llmt", MFnNumericData::kDouble, -1.57, &status); ia_lowerLimit = fnNumericAttr.create("lowerLimit", "llmt", MFnNumericData::kDouble, -90.0, &status);
MCHECKSTATUS(status, "creating lower limit attribute") MCHECKSTATUS(status, "creating lower limit attribute")
fnNumericAttr.setKeyable(true); fnNumericAttr.setKeyable(true);
status = addAttribute(ia_lowerLimit); status = addAttribute(ia_lowerLimit);
MCHECKSTATUS(status, "adding lower limit attribute") MCHECKSTATUS(status, "adding lower limit attribute")
ia_upperLimit = fnNumericAttr.create("upperLimit", "ulmt", MFnNumericData::kDouble, 1.57, &status); ia_upperLimit = fnNumericAttr.create("upperLimit", "ulmt", MFnNumericData::kDouble, 90.0, &status);
MCHECKSTATUS(status, "creating upper limit attribute") MCHECKSTATUS(status, "creating upper limit attribute")
fnNumericAttr.setKeyable(true); fnNumericAttr.setKeyable(true);
status = addAttribute(ia_upperLimit); status = addAttribute(ia_upperLimit);
@@ -107,11 +122,30 @@ MStatus hingeConstraintNode::initialize()
status = addAttribute(ia_relaxationFactor); status = addAttribute(ia_relaxationFactor);
MCHECKSTATUS(status, "adding relaxationFactor attribute") MCHECKSTATUS(status, "adding relaxationFactor attribute")
ia_hingeAxis = fnNumericAttr.createPoint("hingeAxis", "hgAx", &status); ia_rotationInA = fnNumericAttr.createPoint("rotationInA", "hgRotA", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 1.0); status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating hingeAxis attribute") MCHECKSTATUS(status, "creating rotationInA attribute")
status = addAttribute(ia_hingeAxis); status = addAttribute(ia_rotationInA);
MCHECKSTATUS(status, "adding hingeAxis attribute") MCHECKSTATUS(status, "adding rotationInA attribute")
ia_rotationInB = fnNumericAttr.createPoint("rotationInB", "hgRotB", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating rotationInB attribute")
status = addAttribute(ia_rotationInB);
MCHECKSTATUS(status, "adding rotationInB attribute")
ia_pivotInA = fnNumericAttr.createPoint("pivotInA", "pivinA", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating pivotInA attribute")
status = addAttribute(ia_pivotInA);
MCHECKSTATUS(status, "adding pivotInA attribute")
ia_pivotInB = fnNumericAttr.createPoint("pivotInB", "pivinB", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating pivotInB attribute")
status = addAttribute(ia_pivotInB);
MCHECKSTATUS(status, "adding pivotInB attribute")
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@@ -153,11 +187,17 @@ MStatus hingeConstraintNode::initialize()
MCHECKSTATUS(status, "adding ca_constraintParam attribute") MCHECKSTATUS(status, "adding ca_constraintParam attribute")
status = attributeAffects(ia_rigidBody, ca_constraint); status = attributeAffects(ia_rigidBodyA, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBody, ca_constraint)") MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyA, ca_constraint)")
status = attributeAffects(ia_rigidBody, ca_constraintParam); status = attributeAffects(ia_rigidBodyA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBody, ca_constraintParam)") MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyA, ca_constraintParam)")
status = attributeAffects(ia_rigidBodyB, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyB, ca_constraint)")
status = attributeAffects(ia_rigidBodyB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyB, ca_constraintParam)")
status = attributeAffects(ia_damping, ca_constraintParam); status = attributeAffects(ia_damping, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_damping, ca_constraintParam)") MCHECKSTATUS(status, "adding attributeAffects(ia_damping, ca_constraintParam)")
@@ -175,8 +215,16 @@ MStatus hingeConstraintNode::initialize()
status = attributeAffects(ia_relaxationFactor, ca_constraintParam); status = attributeAffects(ia_relaxationFactor, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_relaxationFactor, ca_constraintParam)") MCHECKSTATUS(status, "adding attributeAffects(ia_relaxationFactor, ca_constraintParam)")
status = attributeAffects(ia_hingeAxis, ca_constraintParam); status = attributeAffects(ia_rotationInA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_hingeAxis, ca_constraintParam)") MCHECKSTATUS(status, "adding attributeAffects(ia_rotationInA, ca_constraintParam)")
status = attributeAffects(ia_rotationInB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rotationInB, ca_constraintParam)")
status = attributeAffects(ia_pivotInA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInA, ca_constraintParam)")
status = attributeAffects(ia_pivotInB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInB, ca_constraintParam)")
status = attributeAffects(ia_enableAngularMotor, ca_constraintParam); status = attributeAffects(ia_enableAngularMotor, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_enableAngularMotor, ca_constraintParam)") MCHECKSTATUS(status, "adding attributeAffects(ia_enableAngularMotor, ca_constraintParam)")
@@ -203,6 +251,20 @@ void hingeConstraintNode::nodeRemoved(MObject& node, void *clientData)
// std::cout << "hingeConstraintNode::nodeRemoved" << std::endl; // std::cout << "hingeConstraintNode::nodeRemoved" << std::endl;
MFnDependencyNode fnNode(node); MFnDependencyNode fnNode(node);
hingeConstraintNode *pNode = static_cast<hingeConstraintNode*>(fnNode.userNode()); hingeConstraintNode *pNode = static_cast<hingeConstraintNode*>(fnNode.userNode());
if (pNode->m_constraint)
{
bt_hinge_constraint_t* hinge_impl = dynamic_cast<bt_hinge_constraint_t*>(pNode->m_constraint->pubImpl());
rigid_body_t::pointer rigid_bodyA = pNode->m_constraint->rigid_bodyA();
if(rigid_bodyA)
{
rigid_bodyA->remove_constraint(hinge_impl);
}
rigid_body_t::pointer rigid_bodyB = pNode->m_constraint->rigid_bodyB();
if(rigid_bodyB)
{
rigid_bodyB->remove_constraint(hinge_impl);
}
}
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(pNode->m_constraint); constraint_t::pointer constraint = static_cast<constraint_t::pointer>(pNode->m_constraint);
solver_t::remove_constraint(constraint); solver_t::remove_constraint(constraint);
} }
@@ -265,19 +327,37 @@ void hingeConstraintNode::draw( M3dView & view, const MDagPath &path,
glColor3f(1.0, 1.0, 0.0); glColor3f(1.0, 1.0, 0.0);
} }
vec3f posA, posB, pivB;
rigid_body_t::pointer rigid_bodyB = NULL;
if (m_constraint)
{
vec3f pos; vec3f pos;
if (m_constraint) { quatf rot;
vec3f world; m_constraint->rigid_bodyA()->get_transform(pos, rot);
m_constraint->get_world(world); m_constraint->worldToA(pos, posA);
vec3f posA; rigid_bodyB = m_constraint->rigid_bodyB();
quatf rotA; if(rigid_bodyB)
m_constraint->rigid_body()->get_transform(posA, rotA); {
pos = posA - world; rigid_bodyB->get_transform(pos, rot);
m_constraint->worldToA(pos, posB);
}
m_constraint->worldFromB(vec3f(0.f, 0.f, 0.f), pos);
m_constraint->worldToA(pos, pivB);
} }
glBegin(GL_LINES); glBegin(GL_LINES);
glVertex3f(0.0, 0.0, 0.0); glVertex3f(0.0, 0.0, 0.0);
glVertex3f(pos[0], pos[1], pos[2]); glVertex3f(posA[0], posA[1], posA[2]);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(pivB[0], pivB[1], pivB[2]);
if(rigid_bodyB)
{
glVertex3f(pivB[0], pivB[1], pivB[2]);
glVertex3f(posB[0], posB[1], posB[2]);
}
glVertex3f(-1.0, 0.0, 0.0); glVertex3f(-1.0, 0.0, 0.0);
glVertex3f(1.0, 0.0, 0.0); glVertex3f(1.0, 0.0, 0.0);
@@ -287,6 +367,29 @@ void hingeConstraintNode::draw( M3dView & view, const MDagPath &path,
glVertex3f(0.0, 0.0, -1.0); glVertex3f(0.0, 0.0, -1.0);
glVertex3f(0.0, 0.0, 1.0); glVertex3f(0.0, 0.0, 1.0);
vec3f posT, posP, posM;
m_constraint->worldFromB(vec3f(-1.f, 0.f, 0.f), posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(vec3f( 1.f, 0.f, 0.f), posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
m_constraint->worldFromB(vec3f( 0.f, -1.f, 0.f), posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(vec3f( 0.f, 1.f, 0.f), posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
m_constraint->worldFromB(vec3f( 0.f, 0.f, -1.f), posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(vec3f( 0.f, 0.f, 1.f), posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
glEnd(); glEnd();
glPopAttrib(); glPopAttrib();
@@ -316,31 +419,82 @@ void hingeConstraintNode::computeConstraint(const MPlug& plug, MDataBlock& data)
// std::cout << "hingeConstraintNode::computeConstraint" << std::endl; // std::cout << "hingeConstraintNode::computeConstraint" << std::endl;
MObject thisObject(thisMObject()); MObject thisObject(thisMObject());
MPlug plgRigidBody(thisObject, ia_rigidBody); MPlug plgRigidBodyA(thisObject, ia_rigidBodyA);
MPlug plgRigidBodyB(thisObject, ia_rigidBodyB);
MObject update; MObject update;
//force evaluation of the rigidBody //force evaluation of the rigidBody
plgRigidBody.getValue(update); plgRigidBodyA.getValue(update);
plgRigidBodyB.getValue(update);
rigid_body_t::pointer rigid_body; rigid_body_t::pointer rigid_bodyA;
if(plgRigidBody.isConnected()) { if(plgRigidBodyA.isConnected()) {
MPlugArray connections; MPlugArray connections;
plgRigidBody.connectedTo(connections, true, true); plgRigidBodyA.connectedTo(connections, true, true);
if(connections.length() != 0) { if(connections.length() != 0) {
MFnDependencyNode fnNode(connections[0].node()); MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId) { if(fnNode.typeId() == rigidBodyNode::typeId) {
rigidBodyNode *pRigidBodyNode = static_cast<rigidBodyNode*>(fnNode.userNode()); rigidBodyNode *pRigidBodyNodeA = static_cast<rigidBodyNode*>(fnNode.userNode());
rigid_body = pRigidBodyNode->rigid_body(); rigid_bodyA = pRigidBodyNodeA->rigid_body();
} else { } else {
std::cout << "hingeConstraintNode connected to a non-rigidbody node!" << std::endl; std::cout << "hingeConstraintNode connected to a non-rigidbody node A!" << std::endl;
}
}
}
rigid_body_t::pointer rigid_bodyB;
if(plgRigidBodyB.isConnected()) {
MPlugArray connections;
plgRigidBodyB.connectedTo(connections, true, true);
if(connections.length() != 0) {
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId) {
rigidBodyNode *pRigidBodyNodeB = static_cast<rigidBodyNode*>(fnNode.userNode());
rigid_bodyB = pRigidBodyNodeB->rigid_body();
} else {
std::cout << "hingeConstraintNode connected to a non-rigidbody node B!" << std::endl;
} }
} }
} }
if(rigid_body) { vec3f pivInA, pivInB;
if((rigid_bodyA != NULL) && (rigid_bodyB != NULL))
{
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint);
float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
float3& mPivInB = data.inputValue(ia_pivotInB).asFloat3();
for(int i = 0; i < 3; i++)
{
pivInA[i] = (float)mPivInA[i];
pivInB[i] = (float)mPivInB[i];
}
float3& mRotInA = data.inputValue(ia_rotationInA).asFloat3();
MEulerRotation meulerA(deg2rad(mRotInA[0]), deg2rad(mRotInA[1]), deg2rad(mRotInA[2]));
MQuaternion mquatA = meulerA.asQuaternion();
quatf rotA((float)mquatA.w, (float)mquatA.x, (float)mquatA.y, (float)mquatA.z);
float3& mRotInB = data.inputValue(ia_rotationInB).asFloat3();
MEulerRotation meulerB(deg2rad(mRotInB[0]), deg2rad(mRotInB[1]), deg2rad(mRotInB[2]));
MQuaternion mquatB = meulerB.asQuaternion();
quatf rotB((float)mquatB.w, (float)mquatB.x, (float)mquatB.y, (float)mquatB.z);
m_constraint = solver_t::create_hinge_constraint(rigid_bodyA, pivInA, rotA, rigid_bodyB, pivInB, rotB);
constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint);
}
else if(rigid_bodyA != NULL)
{
//not connected to a rigid body, put a default one //not connected to a rigid body, put a default one
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint); constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint); solver_t::remove_constraint(constraint);
m_constraint = solver_t::create_hinge_constraint(rigid_body); float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
for(int i = 0; i < 3; i++)
{
pivInA[i] = (float)mPivInA[i];
}
float3& mRotInA = data.inputValue(ia_rotationInA).asFloat3();
MEulerRotation meuler(deg2rad(mRotInA[0]), deg2rad(mRotInA[1]), deg2rad(mRotInA[2]));
MQuaternion mquat = meuler.asQuaternion();
quatf rotA((float)mquat.w, (float)mquat.x, (float)mquat.y, (float)mquat.z);
m_constraint = solver_t::create_hinge_constraint(rigid_bodyA, pivInA, rotA);
constraint = static_cast<constraint_t::pointer>(m_constraint); constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint); solver_t::add_constraint(constraint);
} }
@@ -349,11 +503,8 @@ void hingeConstraintNode::computeConstraint(const MPlug& plug, MDataBlock& data)
data.setClean(plug); data.setClean(plug);
} }
void hingeConstraintNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data) void hingeConstraintNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data)
{ {
// std::cout << "hingeConstraintNode::computeWorldMatrix" << std::endl;
MObject thisObject(thisMObject()); MObject thisObject(thisMObject());
MFnDagNode fnDagNode(thisObject); MFnDagNode fnDagNode(thisObject);
@@ -361,31 +512,117 @@ void hingeConstraintNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data
MPlug(thisObject, ca_constraint).getValue(update); MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update); MPlug(thisObject, ca_constraintParam).getValue(update);
MStatus status; MStatus status;
MFnTransform fnParentTransform(fnDagNode.parent(0, &status)); MFnTransform fnParentTransform(fnDagNode.parent(0, &status));
double fixScale[3] = { 1., 1., 1. }; // lock scale
fnParentTransform.setScale(fixScale);
MVector mtranslation = fnParentTransform.getTranslation(MSpace::kTransform, &status); MVector mtranslation = fnParentTransform.getTranslation(MSpace::kTransform, &status);
// MQuaternion mrotation; if(dSolverNode::isStartTime)
// fnParentTransform.getRotation(mrotation, MSpace::kTransform); { // allow to edit pivots
MPlug plgRigidBodyA(thisObject, ia_rigidBodyA);
if(m_constraint) { MPlug plgRigidBodyB(thisObject, ia_rigidBodyB);
vec3f world_pivot; MObject update;
m_constraint->get_world(world_pivot); //force evaluation of the rigidBody
if(world_pivot[0] != float(mtranslation.x) || plgRigidBodyA.getValue(update);
world_pivot[1] != float(mtranslation.y) || if(plgRigidBodyA.isConnected())
world_pivot[2] != float(mtranslation.z)) { {
MPlugArray connections;
// mat4x4f xform; plgRigidBodyA.connectedTo(connections, true, true);
// m_constraint->rigid_body()->get_transform(xform); if(connections.length() != 0)
// vec4f pivot = prod(trans(xform), vec4f(mtranslation.x, mtranslation.y, mtranslation.z, 1.0)); {
// m_constraint->set_pivot(vec3f(pivot[0], pivot[1], pivot[2])); MFnDependencyNode fnNode(connections[0].node());
m_constraint->set_world(vec3f((float) mtranslation[0], (float) mtranslation[1], (float) mtranslation[2])); if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbAObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeA = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbAObj, pRigidBodyNodeA->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
plgRigidBodyB.getValue(update);
if(plgRigidBodyB.isConnected())
{
MPlugArray connections;
plgRigidBodyB.connectedTo(connections, true, true);
if(connections.length() != 0)
{
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbBObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeB = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbBObj, pRigidBodyNodeB->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
if(m_constraint)
{
MQuaternion mrotation;
fnParentTransform.getRotation(mrotation, MSpace::kTransform);
bool doUpdatePivot = m_constraint->getPivotChanged();
if(!doUpdatePivot)
{
vec3f worldP;
quatf worldR;
m_constraint->get_world(worldP, worldR);
float deltaPX = worldP[0] - float(mtranslation.x);
float deltaPY = worldP[1] - float(mtranslation.y);
float deltaPZ = worldP[2] - float(mtranslation.z);
float deltaRX = (float)mrotation.x - worldR[1];
float deltaRY = (float)mrotation.y - worldR[2];
float deltaRZ = (float)mrotation.z - worldR[3];
float deltaRW = (float)mrotation.w - worldR[0];
float deltaSq = deltaPX * deltaPX + deltaPY * deltaPY + deltaPZ * deltaPZ
+ deltaRX * deltaRX + deltaRY * deltaRY + deltaRZ * deltaRZ + deltaRW * deltaRW;
doUpdatePivot = (deltaSq > FLT_EPSILON);
}
if(doUpdatePivot)
{
m_constraint->set_world(vec3f((float) mtranslation[0], (float) mtranslation[1], (float) mtranslation[2]),
quatf((float)mrotation.w, (float)mrotation.x, (float)mrotation.y, (float)mrotation.z));
vec3f pivInA, pivInB;
quatf rotInA, rotInB;
m_constraint->get_frameA(pivInA, rotInA);
m_constraint->get_frameB(pivInB, rotInB);
MDataHandle hPivInA = data.outputValue(ia_pivotInA);
float3 &ihPivInA = hPivInA.asFloat3();
MDataHandle hPivInB = data.outputValue(ia_pivotInB);
float3 &ihPivInB = hPivInB.asFloat3();
for(int i = 0; i < 3; i++)
{
ihPivInA[i] = pivInA[i];
ihPivInB[i] = pivInB[i];
}
MDataHandle hRotInA = data.outputValue(ia_rotationInA);
float3 &hrotInA = hRotInA.asFloat3();
MQuaternion mrotA(rotInA[1], rotInA[2], rotInA[3], rotInA[0]);
MEulerRotation newrotA(mrotA.asEulerRotation());
hrotInA[0] = rad2deg((float)newrotA.x);
hrotInA[1] = rad2deg((float)newrotA.y);
hrotInA[2] = rad2deg((float)newrotA.z);
MDataHandle hRotInB = data.outputValue(ia_rotationInB);
float3 &hrotInB = hRotInB.asFloat3();
MQuaternion mrotB(rotInB[1], rotInB[2], rotInB[3], rotInB[0]);
MEulerRotation newrotB(mrotB.asEulerRotation());
hrotInB[0] = rad2deg((float)newrotB.x);
hrotInB[1] = rad2deg((float)newrotB.y);
hrotInB[2] = rad2deg((float)newrotB.z);
m_constraint->setPivotChanged(false);
}
}
}
else
{ // if not start time, lock position and rotation
if(m_constraint)
{
vec3f worldP;
quatf worldR;
m_constraint->get_world(worldP, worldR);
fnParentTransform.setTranslation(MVector(worldP[0], worldP[1], worldP[2]), MSpace::kTransform);
fnParentTransform.setRotation(MQuaternion(worldR[1], worldR[2], worldR[3], worldR[0]));
} }
} }
data.setClean(plug); data.setClean(plug);
} }
@@ -405,12 +642,7 @@ void hingeConstraintNode::computeConstraintParam(const MPlug& plug, MDataBlock&
float limit_softness = (float) data.inputValue(ia_limitSoftness).asDouble(); float limit_softness = (float) data.inputValue(ia_limitSoftness).asDouble();
float bias_factor = (float) data.inputValue(ia_biasFactor).asDouble(); float bias_factor = (float) data.inputValue(ia_biasFactor).asDouble();
float relaxation_factor = (float) data.inputValue(ia_relaxationFactor).asDouble(); float relaxation_factor = (float) data.inputValue(ia_relaxationFactor).asDouble();
m_constraint->set_limit(deg2rad(lower), deg2rad(upper), limit_softness, bias_factor, relaxation_factor);
m_constraint->set_limit(lower, upper, limit_softness, bias_factor, relaxation_factor);
float* axis = data.inputValue(ia_hingeAxis).asFloat3();
m_constraint->set_axis(vec3f(axis[0], axis[1], axis[2]));
bool enable_motor = data.inputValue(ia_enableAngularMotor).asBool(); bool enable_motor = data.inputValue(ia_enableAngularMotor).asBool();
float motorTargetVelocity = (float) data.inputValue(ia_motorTargetVelocity).asDouble(); float motorTargetVelocity = (float) data.inputValue(ia_motorTargetVelocity).asDouble();
float maxMotorImpulse = (float) data.inputValue(ia_maxMotorImpulse).asDouble(); float maxMotorImpulse = (float) data.inputValue(ia_maxMotorImpulse).asDouble();

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//hingeConstraintNode.h //hingeConstraintNode.h
@@ -62,11 +65,13 @@ public:
public: public:
hinge_constraint_t::pointer constraint(); hinge_constraint_t::pointer constraint();
void update();
public: public:
//Attributes //Attributes
static MObject ia_rigidBody; static MObject ia_rigidBodyA;
static MObject ia_rigidBodyB;
static MObject ia_damping; static MObject ia_damping;
static MObject ia_lowerLimit; static MObject ia_lowerLimit;
@@ -75,7 +80,11 @@ public:
static MObject ia_biasFactor; static MObject ia_biasFactor;
static MObject ia_relaxationFactor; static MObject ia_relaxationFactor;
static MObject ia_hingeAxis; static MObject ia_rotationInA;
static MObject ia_rotationInB;
static MObject ia_pivotInA;
static MObject ia_pivotInB;
static MObject ca_constraint; static MObject ca_constraint;
static MObject ca_constraintParam; static MObject ca_constraintParam;
@@ -89,7 +98,6 @@ public:
static MString typeName; static MString typeName;
private: private:
void update();
void computeConstraint(const MPlug& plug, MDataBlock& data); void computeConstraint(const MPlug& plug, MDataBlock& data);
void computeConstraintParam(const MPlug& plug, MDataBlock& data); void computeConstraintParam(const MPlug& plug, MDataBlock& data);
void computeWorldMatrix(const MPlug& plug, MDataBlock& data); void computeWorldMatrix(const MPlug& plug, MDataBlock& data);

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//hinge_constraint.h //hinge_constraint.h
@@ -39,25 +42,33 @@ public:
typedef shared_ptr<hinge_constraint_t> pointer; typedef shared_ptr<hinge_constraint_t> pointer;
// //
rigid_body_t::pointer rigid_body() { return m_rigid_body; } rigid_body_t::pointer rigid_bodyA() { return m_rigid_bodyA; }
rigid_body_t::pointer rigid_bodyB() { return m_rigid_bodyB; }
// //
void set_pivot(vec3f const& p) void get_frameA(vec3f& p, quatf& r) const {
{
hinge_constraint_impl_t* hinge_impl = dynamic_cast<hinge_constraint_impl_t*>(impl());
hinge_impl->set_pivot(p);
}
//local space pivot
void get_pivot(vec3f& p) const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl()); hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
hinge_impl->get_pivot(p); hinge_impl->get_frameA(p, r);
} }
void get_frameB(vec3f& p, quatf& r) const {
//
void get_world_pivot(vec3f& p) const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl()); hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
hinge_impl->get_world_pivot(p); hinge_impl->get_frameB(p, r);
}
void get_invFrameA(vec3f& p, quatf& r) const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
hinge_impl->get_invFrameA(p, r);
}
void get_invFrameB(vec3f& p, quatf& r) const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
hinge_impl->get_invFrameB(p, r);
}
void worldToA(vec3f& w, vec3f& p) const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
hinge_impl->worldToA(w, p);
}
void worldFromB(vec3f& p, vec3f& w) const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
hinge_impl->worldFromB(p, w);
} }
// //
@@ -81,16 +92,16 @@ public:
return hinge_impl->damping(); return hinge_impl->damping();
} }
void set_world(vec3f const& p) void set_world(vec3f const& p, quatf const& r)
{ {
hinge_constraint_impl_t* hinge_impl = dynamic_cast<hinge_constraint_impl_t*>(impl()); hinge_constraint_impl_t* hinge_impl = dynamic_cast<hinge_constraint_impl_t*>(impl());
hinge_impl->set_world(p); hinge_impl->set_world(p, r);
} }
//local space pivot //local space pivot
void get_world(vec3f& p) const { void get_world(vec3f& p, quatf& r) const {
hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl()); hinge_constraint_impl_t const* hinge_impl = dynamic_cast<hinge_constraint_impl_t const*>(impl());
hinge_impl->get_world(p); hinge_impl->get_world(p, r);
} }
void enable_motor(bool enable, float velocity, float impulse) { void enable_motor(bool enable, float velocity, float impulse) {
@@ -105,12 +116,19 @@ protected:
friend class solver_t; friend class solver_t;
hinge_constraint_t(hinge_constraint_impl_t* impl, rigid_body_t::pointer& rigid_body): hinge_constraint_t(hinge_constraint_impl_t* impl, rigid_body_t::pointer& rigid_body):
constraint_t(impl), constraint_t(impl),
m_rigid_body(rigid_body) m_rigid_bodyA(rigid_body)
{
}
hinge_constraint_t(hinge_constraint_impl_t* impl, rigid_body_t::pointer& rigid_bodyA, rigid_body_t::pointer& rigid_bodyB):
constraint_t(impl),
m_rigid_bodyA(rigid_bodyA),
m_rigid_bodyB(rigid_bodyB)
{ {
} }
private: private:
rigid_body_t::pointer m_rigid_body; rigid_body_t::pointer m_rigid_bodyA;
rigid_body_t::pointer m_rigid_bodyB;
}; };

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//hinge_constraint_impl.h //hinge_constraint_impl.h
@@ -31,11 +34,14 @@ class hinge_constraint_impl_t: public constraint_impl_t
{ {
public: public:
// //
virtual void set_pivot(vec3f const& p) = 0; virtual void set_world(vec3f const& p, quatf const& r) = 0;
virtual void get_pivot(vec3f& p) const = 0; virtual void get_world(vec3f& p, quatf& r) const = 0;
virtual void get_world_pivot(vec3f& p) const = 0; virtual void get_frameA(vec3f& p, quatf& r) const = 0;
virtual void set_world(vec3f const& p) = 0; virtual void get_frameB(vec3f& p, quatf& r) const = 0;
virtual void get_world(vec3f& p) const = 0; virtual void get_invFrameA(vec3f& p, quatf& r) const = 0;
virtual void get_invFrameB(vec3f& p, quatf& r) const = 0;
virtual void worldToA(vec3f& w, vec3f& p) const = 0;
virtual void worldFromB(vec3f& p, vec3f& w) const = 0;
// //
virtual void set_damping(float d) = 0; virtual void set_damping(float d) = 0;

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//nailConstraintNode.cpp //nailConstraintNode.cpp
@@ -43,6 +42,8 @@ Modified by Roman Ponomarev <rponom@gmail.com>
#include "mayaUtils.h" #include "mayaUtils.h"
#include "solver.h" #include "solver.h"
#include "dSolverNode.h"
#include "constraint/bt_nail_constraint.h"
MTypeId nailConstraintNode::typeId(0x10033A); MTypeId nailConstraintNode::typeId(0x10033A);
MString nailConstraintNode::typeName("dNailConstraint"); MString nailConstraintNode::typeName("dNailConstraint");
@@ -50,6 +51,8 @@ MString nailConstraintNode::typeName("dNailConstraint");
MObject nailConstraintNode::ia_rigidBodyA; MObject nailConstraintNode::ia_rigidBodyA;
MObject nailConstraintNode::ia_rigidBodyB; MObject nailConstraintNode::ia_rigidBodyB;
MObject nailConstraintNode::ia_damping; MObject nailConstraintNode::ia_damping;
MObject nailConstraintNode::ia_pivotInA;
MObject nailConstraintNode::ia_pivotInB;
MObject nailConstraintNode::ca_constraint; MObject nailConstraintNode::ca_constraint;
MObject nailConstraintNode::ca_constraintParam; MObject nailConstraintNode::ca_constraintParam;
@@ -77,6 +80,16 @@ MStatus nailConstraintNode::initialize()
status = addAttribute(ia_damping); status = addAttribute(ia_damping);
MCHECKSTATUS(status, "adding damping attribute") MCHECKSTATUS(status, "adding damping attribute")
ia_pivotInA = fnNumericAttr.createPoint("pivotInA", "piva", &status);
MCHECKSTATUS(status, "creating pivotInA attribute")
status = addAttribute(ia_pivotInA);
MCHECKSTATUS(status, "adding pivotInA attribute")
ia_pivotInB = fnNumericAttr.createPoint("pivotInB", "pivb", &status);
MCHECKSTATUS(status, "creating pivotInB attribute")
status = addAttribute(ia_pivotInB);
MCHECKSTATUS(status, "adding pivotInB attribute")
ca_constraint = fnNumericAttr.create("ca_constraint", "caco", MFnNumericData::kBoolean, 0, &status); ca_constraint = fnNumericAttr.create("ca_constraint", "caco", MFnNumericData::kBoolean, 0, &status);
MCHECKSTATUS(status, "creating ca_constraint attribute") MCHECKSTATUS(status, "creating ca_constraint attribute")
fnNumericAttr.setConnectable(false); fnNumericAttr.setConnectable(false);
@@ -108,6 +121,18 @@ MStatus nailConstraintNode::initialize()
status = attributeAffects(ia_rigidBodyB, ca_constraintParam); status = attributeAffects(ia_rigidBodyB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyB, ca_constraintParam)") MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyB, ca_constraintParam)")
status = attributeAffects(ia_pivotInA, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInA, ca_constraint)")
status = attributeAffects(ia_pivotInA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInA, ca_constraintParam)")
status = attributeAffects(ia_pivotInB, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInB, ca_constraint)")
status = attributeAffects(ia_pivotInB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInB, ca_constraintParam)")
status = attributeAffects(ia_damping, ca_constraintParam); status = attributeAffects(ia_damping, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_damping, ca_constraintParam)") MCHECKSTATUS(status, "adding attributeAffects(ia_damping, ca_constraintParam)")
@@ -129,6 +154,21 @@ void nailConstraintNode::nodeRemoved(MObject& node, void *clientData)
// std::cout << "nailConstraintNode::nodeRemoved" << std::endl; // std::cout << "nailConstraintNode::nodeRemoved" << std::endl;
MFnDependencyNode fnNode(node); MFnDependencyNode fnNode(node);
nailConstraintNode *pNode = static_cast<nailConstraintNode*>(fnNode.userNode()); nailConstraintNode *pNode = static_cast<nailConstraintNode*>(fnNode.userNode());
if (pNode->m_constraint)
{
bt_nail_constraint_t* nail_impl = dynamic_cast<bt_nail_constraint_t*>(pNode->m_constraint->pubImpl());
rigid_body_t::pointer rigid_bodyA = pNode->m_constraint->rigid_bodyA();
if(rigid_bodyA)
{
rigid_bodyA->remove_constraint(nail_impl);
}
rigid_body_t::pointer rigid_bodyB = pNode->m_constraint->rigid_bodyB();
if(rigid_bodyB)
{
rigid_bodyB->remove_constraint(nail_impl);
}
}
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(pNode->m_constraint); constraint_t::pointer constraint = static_cast<constraint_t::pointer>(pNode->m_constraint);
solver_t::remove_constraint(constraint); solver_t::remove_constraint(constraint);
} }
@@ -192,8 +232,8 @@ void nailConstraintNode::draw( M3dView & view, const MDagPath &path,
} }
vec3f posA, posB; vec3f posA, posB;
rigid_body_t::pointer rigid_bodyB = NULL; rigid_body_t::pointer rigid_bodyB = NULL;
if (m_constraint) {
vec3f world; vec3f world;
if (m_constraint) {
m_constraint->get_world(world); m_constraint->get_world(world);
vec3f posT; vec3f posT;
quatf rotT; quatf rotT;
@@ -214,8 +254,17 @@ void nailConstraintNode::draw( M3dView & view, const MDagPath &path,
if(rigid_bodyB) if(rigid_bodyB)
{ {
glVertex3f(0.0, 0.0, 0.0); vec3f pivB;
m_constraint->get_world_pivotB(pivB);
for(int j = 0; j < 3; j++) pivB[j] -= world[j];
glVertex3f(pivB[0], pivB[1], pivB[2]);
glVertex3f(posB[0], posB[1], posB[2]); glVertex3f(posB[0], posB[1], posB[2]);
glVertex3f(-1.0f+pivB[0], 0.0f+pivB[1], 0.0f+pivB[2]);
glVertex3f( 1.0f+pivB[0], 0.0f+pivB[1], 0.0f+pivB[2]);
glVertex3f( 0.0f+pivB[0], -1.0f+pivB[1], 0.0f+pivB[2]);
glVertex3f( 0.0f+pivB[0], 1.0f+pivB[1], 0.0f+pivB[2]);
glVertex3f( 0.0f+pivB[0], 0.0f+pivB[1], -1.0f+pivB[2]);
glVertex3f( 0.0f+pivB[0], 0.0f+pivB[1], 1.0f+pivB[2]);
} }
@@ -293,16 +342,20 @@ void nailConstraintNode::computeConstraint(const MPlug& plug, MDataBlock& data)
} }
} }
vec3f pivInA, pivInB;
if((rigid_bodyA != NULL) && (rigid_bodyB != NULL)) if((rigid_bodyA != NULL) && (rigid_bodyB != NULL))
{ {
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint); constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint); solver_t::remove_constraint(constraint);
vec3f posA, posB, posP; float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
quatf rotA, rotB; float3& mPivInB = data.inputValue(ia_pivotInB).asFloat3();
rigid_bodyA->get_transform(posA, rotA); for(int i = 0; i < 3; i++)
rigid_bodyB->get_transform(posB, rotB); {
posP = posA; pivInA[i] = (float)mPivInA[i];
m_constraint = solver_t::create_nail_constraint(rigid_bodyA, rigid_bodyB, posP); pivInB[i] = (float)mPivInB[i];
}
m_constraint = solver_t::create_nail_constraint(rigid_bodyA, rigid_bodyB, pivInA, pivInB);
constraint = static_cast<constraint_t::pointer>(m_constraint); constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint); solver_t::add_constraint(constraint);
} }
@@ -311,28 +364,15 @@ void nailConstraintNode::computeConstraint(const MPlug& plug, MDataBlock& data)
//not connected to a rigid body, put a default one //not connected to a rigid body, put a default one
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint); constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint); solver_t::remove_constraint(constraint);
vec3f posA, posP; float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
quatf rotA; for(int i = 0; i < 3; i++)
rigid_bodyA->get_transform(posA, rotA); {
posP = posA; pivInA[i] = (float)mPivInA[i];
m_constraint = solver_t::create_nail_constraint(rigid_bodyA, posP); }
m_constraint = solver_t::create_nail_constraint(rigid_bodyA, pivInA);
constraint = static_cast<constraint_t::pointer>(m_constraint); constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint); solver_t::add_constraint(constraint);
} }
MFnDagNode mDagNode(thisObject);
if(mDagNode.parentCount() == 0)
{
std::cout << "No transform for nail constraint found!" << std::endl;
}
else
{
MFnTransform mTransform(mDagNode.parent(0));
vec3f constrPos;
m_constraint->get_world(constrPos);
mTransform.setTranslation(MVector(constrPos[0], constrPos[1], constrPos[2]), MSpace::kTransform);
}
data.outputValue(ca_constraint).set(true); data.outputValue(ca_constraint).set(true);
data.setClean(plug); data.setClean(plug);
} }
@@ -349,40 +389,92 @@ void nailConstraintNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data)
MPlug(thisObject, ca_constraint).getValue(update); MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update); MPlug(thisObject, ca_constraintParam).getValue(update);
MStatus status; MStatus status;
MFnTransform fnParentTransform(fnDagNode.parent(0, &status)); MFnTransform fnParentTransform(fnDagNode.parent(0, &status));
fnParentTransform.setRotation(MEulerRotation(0., 0., 0.)); // lock rotation
double fixScale[3] = { 1., 1., 1. }; // lock scale
fnParentTransform.setScale(fixScale);
MVector mtranslation = fnParentTransform.getTranslation(MSpace::kTransform, &status); MVector mtranslation = fnParentTransform.getTranslation(MSpace::kTransform, &status);
// MQuaternion mrotation; if(dSolverNode::isStartTime)
// fnParentTransform.getRotation(mrotation, MSpace::kTransform); { // allow to edit pivots
MPlug plgRigidBodyA(thisObject, ia_rigidBodyA);
if(m_constraint) { MPlug plgRigidBodyB(thisObject, ia_rigidBodyB);
MObject update;
//force evaluation of the rigidBody
plgRigidBodyA.getValue(update);
if(plgRigidBodyA.isConnected())
{
MPlugArray connections;
plgRigidBodyA.connectedTo(connections, true, true);
if(connections.length() != 0)
{
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbAObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeA = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbAObj, pRigidBodyNodeA->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
plgRigidBodyB.getValue(update);
if(plgRigidBodyB.isConnected())
{
MPlugArray connections;
plgRigidBodyB.connectedTo(connections, true, true);
if(connections.length() != 0)
{
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbBObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeB = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbBObj, pRigidBodyNodeB->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
if(m_constraint)
{
bool doUpdatePivot = m_constraint->getPivotChanged();
if(!doUpdatePivot)
{
vec3f world; vec3f world;
m_constraint->get_world(world); m_constraint->get_world(world);
if(world[0] != float(mtranslation.x) ||
world[1] != float(mtranslation.y) ||
world[2] != float(mtranslation.z)) {
/* mat4x4f xform;
m_constraint->rigid_body()->get_transform(xform);
vec4f pivot = prod(trans(xform), vec4f(mtranslation.x, mtranslation.y, mtranslation.z, 1.0));
std::cout << "pivot (" << pivot[0] << "," << pivot[0] << "," << pivot[0] << ")" << std::endl;
*/
// std::cout << "mtranslation (" << mtranslation[0] << "," << mtranslation[0] << "," << mtranslation[0] << ")" << std::endl;
float deltaX = world[0] - float(mtranslation.x); float deltaX = world[0] - float(mtranslation.x);
float deltaY = world[1] - float(mtranslation.y); float deltaY = world[1] - float(mtranslation.y);
float deltaZ = world[2] - float(mtranslation.z); float deltaZ = world[2] - float(mtranslation.z);
float deltaSq = deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ; float deltaSq = deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ;
if(deltaSq > 0.000001f) doUpdatePivot = (deltaSq > FLT_EPSILON);
}
if(doUpdatePivot)
{ {
m_constraint->set_world(vec3f((float) mtranslation[0], (float) mtranslation[1], (float) mtranslation[2])); m_constraint->set_world(vec3f((float) mtranslation[0], (float) mtranslation[1], (float) mtranslation[2]));
vec3f pivInA, pivInB;
m_constraint->get_pivotA(pivInA);
m_constraint->get_pivotB(pivInB);
MDataHandle hPivInA = data.outputValue(ia_pivotInA);
float3 &ihPivInA = hPivInA.asFloat3();
MDataHandle hPivInB = data.outputValue(ia_pivotInB);
float3 &ihPivInB = hPivInB.asFloat3();
for(int i = 0; i < 3; i++)
{
ihPivInA[i] = pivInA[i];
ihPivInB[i] = pivInB[i];
}
m_constraint->setPivotChanged(false);
} }
} }
} }
else
{ // if not start time, lock position
if(m_constraint)
{
vec3f world;
m_constraint->get_world(world);
fnParentTransform.setTranslation(MVector(world[0], world[1], world[2]), MSpace::kTransform);
}
}
data.setClean(plug); data.setClean(plug);
} }

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//nailConstraintNode.h //nailConstraintNode.h
@@ -66,6 +65,7 @@ public:
public: public:
nail_constraint_t::pointer constraint(); nail_constraint_t::pointer constraint();
void update();
public: public:
@@ -73,6 +73,8 @@ public:
static MObject ia_rigidBodyA; static MObject ia_rigidBodyA;
static MObject ia_rigidBodyB; static MObject ia_rigidBodyB;
static MObject ia_damping; static MObject ia_damping;
static MObject ia_pivotInA;
static MObject ia_pivotInB;
static MObject ca_constraint; static MObject ca_constraint;
static MObject ca_constraintParam; static MObject ca_constraintParam;
@@ -82,7 +84,6 @@ public:
static MString typeName; static MString typeName;
private: private:
void update();
void computeConstraint(const MPlug& plug, MDataBlock& data); void computeConstraint(const MPlug& plug, MDataBlock& data);
void computeConstraintParam(const MPlug& plug, MDataBlock& data); void computeConstraintParam(const MPlug& plug, MDataBlock& data);
void computeWorldMatrix(const MPlug& plug, MDataBlock& data); void computeWorldMatrix(const MPlug& plug, MDataBlock& data);

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//nail_constraint.h //nail_constraint.h
@@ -46,17 +45,32 @@ public:
rigid_body_t::pointer rigid_bodyA() { return m_rigid_bodyA; } rigid_body_t::pointer rigid_bodyA() { return m_rigid_bodyA; }
rigid_body_t::pointer rigid_bodyB() { return m_rigid_bodyB; } rigid_body_t::pointer rigid_bodyB() { return m_rigid_bodyB; }
// //local space pivots
void set_pivotA(vec3f const& p) { void set_pivotA(vec3f const& p) {
nail_constraint_impl_t* nail_impl = dynamic_cast<nail_constraint_impl_t*>(impl()); nail_constraint_impl_t* nail_impl = dynamic_cast<nail_constraint_impl_t*>(impl());
nail_impl->set_pivotA(p); nail_impl->set_pivotA(p);
} }
//local space pivot
void get_pivotA(vec3f& p) const { void get_pivotA(vec3f& p) const {
nail_constraint_impl_t const* nail_impl = dynamic_cast<nail_constraint_impl_t const*>(impl()); nail_constraint_impl_t const* nail_impl = dynamic_cast<nail_constraint_impl_t const*>(impl());
nail_impl->get_pivotA(p); nail_impl->get_pivotA(p);
} }
void set_pivotB(vec3f const& p) {
nail_constraint_impl_t* nail_impl = dynamic_cast<nail_constraint_impl_t*>(impl());
nail_impl->set_pivotB(p);
}
void get_pivotB(vec3f& p) const {
nail_constraint_impl_t const* nail_impl = dynamic_cast<nail_constraint_impl_t const*>(impl());
nail_impl->get_pivotB(p);
}
//world space pivots
void get_world_pivotA(vec3f& p) const {
nail_constraint_impl_t const* nail_impl = dynamic_cast<nail_constraint_impl_t const*>(impl());
nail_impl->get_world_pivotA(p);
}
void get_world_pivotB(vec3f& p) const {
nail_constraint_impl_t const* nail_impl = dynamic_cast<nail_constraint_impl_t const*>(impl());
nail_impl->get_world_pivotB(p);
}
// //
void set_world(vec3f const& p) { void set_world(vec3f const& p) {

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//nail_constraint_impl.h //nail_constraint_impl.h
@@ -33,8 +36,12 @@ public:
// //
virtual void set_pivotA(vec3f const& p) = 0; virtual void set_pivotA(vec3f const& p) = 0;
virtual void get_pivotA(vec3f& p) const = 0; virtual void get_pivotA(vec3f& p) const = 0;
virtual void set_pivotB(vec3f const& p) = 0;
virtual void get_pivotB(vec3f& p) const = 0;
virtual void set_world(vec3f const& p) = 0; virtual void set_world(vec3f const& p) = 0;
virtual void get_world(vec3f& p) const = 0; virtual void get_world(vec3f& p) const = 0;
virtual void get_world_pivotA(vec3f& p) const = 0;
virtual void get_world_pivotB(vec3f& p) const = 0;
// //
virtual void set_damping(float d) = 0; virtual void set_damping(float d) = 0;

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//sixdofConstraintNode.cpp //sixdofConstraintNode.cpp
@@ -39,6 +42,8 @@ Written by: Herbert Law <Herbert.Law@gmail.com>
#include "mayaUtils.h" #include "mayaUtils.h"
#include "solver.h" #include "solver.h"
#include "dSolverNode.h"
#include "constraint/bt_sixdof_constraint.h"
MTypeId sixdofConstraintNode::typeId(0x100384); MTypeId sixdofConstraintNode::typeId(0x100384);
MString sixdofConstraintNode::typeName("dSixdofConstraint"); MString sixdofConstraintNode::typeName("dSixdofConstraint");
@@ -52,6 +57,10 @@ MObject sixdofConstraintNode::ia_lowerLinLimit;
MObject sixdofConstraintNode::ia_upperLinLimit; MObject sixdofConstraintNode::ia_upperLinLimit;
MObject sixdofConstraintNode::ia_lowerAngLimit; MObject sixdofConstraintNode::ia_lowerAngLimit;
MObject sixdofConstraintNode::ia_upperAngLimit; MObject sixdofConstraintNode::ia_upperAngLimit;
MObject sixdofConstraintNode::ia_rotationInA;
MObject sixdofConstraintNode::ia_rotationInB;
MObject sixdofConstraintNode::ia_pivotInA;
MObject sixdofConstraintNode::ia_pivotInB;
MStatus sixdofConstraintNode::initialize() MStatus sixdofConstraintNode::initialize()
{ {
@@ -76,26 +85,30 @@ MStatus sixdofConstraintNode::initialize()
status = addAttribute(ia_damping); status = addAttribute(ia_damping);
MCHECKSTATUS(status, "adding damping attribute") MCHECKSTATUS(status, "adding damping attribute")
ia_lowerLinLimit = fnNumericAttr.create("lowerLinLimit", "lllt", MFnNumericData::kDouble, 1, &status); ia_lowerLinLimit = fnNumericAttr.createPoint("lowerLinLimit", "lllt", &status);
MCHECKSTATUS(status, "creating lower linear limit attribute") MCHECKSTATUS(status, "creating lower linear limit attribute")
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
fnNumericAttr.setKeyable(true); fnNumericAttr.setKeyable(true);
status = addAttribute(ia_lowerLinLimit); status = addAttribute(ia_lowerLinLimit);
MCHECKSTATUS(status, "adding lower linear limit attribute") MCHECKSTATUS(status, "adding lower linear limit attribute")
ia_upperLinLimit = fnNumericAttr.create("upperLinLimit", "ullt", MFnNumericData::kDouble, -1, &status); ia_upperLinLimit = fnNumericAttr.createPoint("upperLinLimit", "ullt", &status);
MCHECKSTATUS(status, "creating upper linear limit attribute") MCHECKSTATUS(status, "creating upper linear limit attribute")
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
fnNumericAttr.setKeyable(true); fnNumericAttr.setKeyable(true);
status = addAttribute(ia_upperLinLimit); status = addAttribute(ia_upperLinLimit);
MCHECKSTATUS(status, "adding upper linear limit attribute") MCHECKSTATUS(status, "adding upper linear limit attribute")
ia_lowerAngLimit = fnNumericAttr.create("lowerAngLimit", "lalt", MFnNumericData::kDouble, 0, &status); ia_lowerAngLimit = fnNumericAttr.createPoint("lowerAngLimit", "lalt", &status);
MCHECKSTATUS(status, "creating lower angular limit attribute") MCHECKSTATUS(status, "creating lower angular limit attribute")
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
fnNumericAttr.setKeyable(true); fnNumericAttr.setKeyable(true);
status = addAttribute(ia_lowerAngLimit); status = addAttribute(ia_lowerAngLimit);
MCHECKSTATUS(status, "adding lower angular limit attribute") MCHECKSTATUS(status, "adding lower angular limit attribute")
ia_upperAngLimit = fnNumericAttr.create("upperAngLimit", "ualt", MFnNumericData::kDouble, 0, &status); ia_upperAngLimit = fnNumericAttr.createPoint("upperAngLimit", "ualt", &status);
MCHECKSTATUS(status, "creating upper angular limit attribute") MCHECKSTATUS(status, "creating upper angular limit attribute")
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
fnNumericAttr.setKeyable(true); fnNumericAttr.setKeyable(true);
status = addAttribute(ia_upperAngLimit); status = addAttribute(ia_upperAngLimit);
MCHECKSTATUS(status, "adding upper angular limit attribute") MCHECKSTATUS(status, "adding upper angular limit attribute")
@@ -109,6 +122,7 @@ MStatus sixdofConstraintNode::initialize()
status = addAttribute(ca_constraint); status = addAttribute(ca_constraint);
MCHECKSTATUS(status, "adding ca_constraint attribute") MCHECKSTATUS(status, "adding ca_constraint attribute")
ca_constraintParam = fnNumericAttr.create("ca_constraintParam", "cacop", MFnNumericData::kBoolean, 0, &status); ca_constraintParam = fnNumericAttr.create("ca_constraintParam", "cacop", MFnNumericData::kBoolean, 0, &status);
MCHECKSTATUS(status, "creating ca_constraintParam attribute") MCHECKSTATUS(status, "creating ca_constraintParam attribute")
fnNumericAttr.setConnectable(false); fnNumericAttr.setConnectable(false);
@@ -118,6 +132,30 @@ MStatus sixdofConstraintNode::initialize()
status = addAttribute(ca_constraintParam); status = addAttribute(ca_constraintParam);
MCHECKSTATUS(status, "adding ca_constraintParam attribute") MCHECKSTATUS(status, "adding ca_constraintParam attribute")
ia_rotationInA = fnNumericAttr.createPoint("rotationInA", "hgRotA", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating rotationInA attribute")
status = addAttribute(ia_rotationInA);
MCHECKSTATUS(status, "adding rotationInA attribute")
ia_rotationInB = fnNumericAttr.createPoint("rotationInB", "hgRotB", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating rotationInB attribute")
status = addAttribute(ia_rotationInB);
MCHECKSTATUS(status, "adding rotationInB attribute")
ia_pivotInA = fnNumericAttr.createPoint("pivotInA", "pivinA", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating pivotInA attribute")
status = addAttribute(ia_pivotInA);
MCHECKSTATUS(status, "adding pivotInA attribute")
ia_pivotInB = fnNumericAttr.createPoint("pivotInB", "pivinB", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating pivotInB attribute")
status = addAttribute(ia_pivotInB);
MCHECKSTATUS(status, "adding pivotInB attribute")
status = attributeAffects(ia_rigidBodyA, ca_constraint); status = attributeAffects(ia_rigidBodyA, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyA, ca_constraint)") MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyA, ca_constraint)")
@@ -146,6 +184,17 @@ MStatus sixdofConstraintNode::initialize()
status = attributeAffects(ia_upperAngLimit, ca_constraintParam); status = attributeAffects(ia_upperAngLimit, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_upperAngLimit, ca_constraintParam)") MCHECKSTATUS(status, "adding attributeAffects(ia_upperAngLimit, ca_constraintParam)")
status = attributeAffects(ia_rotationInA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rotationInA, ca_constraintParam)")
status = attributeAffects(ia_rotationInB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rotationInB, ca_constraintParam)")
status = attributeAffects(ia_pivotInA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInA, ca_constraintParam)")
status = attributeAffects(ia_pivotInB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInB, ca_constraintParam)")
return MS::kSuccess; return MS::kSuccess;
} }
@@ -164,6 +213,20 @@ void sixdofConstraintNode::nodeRemoved(MObject& node, void *clientData)
// std::cout << "sixdofConstraintNode::nodeRemoved" << std::endl; // std::cout << "sixdofConstraintNode::nodeRemoved" << std::endl;
MFnDependencyNode fnNode(node); MFnDependencyNode fnNode(node);
sixdofConstraintNode *pNode = static_cast<sixdofConstraintNode*>(fnNode.userNode()); sixdofConstraintNode *pNode = static_cast<sixdofConstraintNode*>(fnNode.userNode());
if (pNode->m_constraint)
{
bt_sixdof_constraint_t* hinge_impl = dynamic_cast<bt_sixdof_constraint_t*>(pNode->m_constraint->pubImpl());
rigid_body_t::pointer rigid_bodyA = pNode->m_constraint->rigid_bodyA();
if(rigid_bodyA)
{
rigid_bodyA->remove_constraint(hinge_impl);
}
rigid_body_t::pointer rigid_bodyB = pNode->m_constraint->rigid_bodyB();
if(rigid_bodyB)
{
rigid_bodyB->remove_constraint(hinge_impl);
}
}
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(pNode->m_constraint); constraint_t::pointer constraint = static_cast<constraint_t::pointer>(pNode->m_constraint);
solver_t::remove_constraint(constraint); solver_t::remove_constraint(constraint);
} }
@@ -210,14 +273,11 @@ void sixdofConstraintNode::draw( M3dView & view, const MDagPath &path,
M3dView::DisplayStyle style, M3dView::DisplayStyle style,
M3dView::DisplayStatus status ) M3dView::DisplayStatus status )
{ {
// std::cout << "sixdofConstraintNode::draw" << std::endl;
update(); update();
view.beginGL(); view.beginGL();
glPushAttrib( GL_ALL_ATTRIB_BITS ); glPushAttrib( GL_ALL_ATTRIB_BITS );
// glPushMatrix();
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
if( !(status == M3dView::kActive || if( !(status == M3dView::kActive ||
@@ -227,23 +287,37 @@ void sixdofConstraintNode::draw( M3dView & view, const MDagPath &path,
glColor3f(1.0, 1.0, 0.0); glColor3f(1.0, 1.0, 0.0);
} }
vec3f posA; vec3f posA, posB, pivB;
vec3f posB; rigid_body_t::pointer rigid_bodyB = NULL;
if (m_constraint) { if (m_constraint)
vec3f world; {
m_constraint->get_world(world); vec3f pos;
quatf rotA; quatf rot;
m_constraint->rigid_bodyA()->get_transform(posA, rotA); m_constraint->rigid_bodyA()->get_transform(pos, rot);
posA = posA - world; m_constraint->worldToA(pos, posA);
quatf rotB; rigid_bodyB = m_constraint->rigid_bodyB();
m_constraint->rigid_bodyB()->get_transform(posB, rotB); if(rigid_bodyB)
posB = posB - world; {
rigid_bodyB->get_transform(pos, rot);
m_constraint->worldToA(pos, posB);
}
m_constraint->worldFromB(vec3f(0.f, 0.f, 0.f), pos);
m_constraint->worldToA(pos, pivB);
} }
// glLoadIdentity();
glBegin(GL_LINES); glBegin(GL_LINES);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(posA[0], posA[1], posA[2]); glVertex3f(posA[0], posA[1], posA[2]);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(pivB[0], pivB[1], pivB[2]);
if(rigid_bodyB)
{
glVertex3f(pivB[0], pivB[1], pivB[2]);
glVertex3f(posB[0], posB[1], posB[2]); glVertex3f(posB[0], posB[1], posB[2]);
}
glVertex3f(-1.0, 0.0, 0.0); glVertex3f(-1.0, 0.0, 0.0);
glVertex3f(1.0, 0.0, 0.0); glVertex3f(1.0, 0.0, 0.0);
@@ -253,9 +327,30 @@ void sixdofConstraintNode::draw( M3dView & view, const MDagPath &path,
glVertex3f(0.0, 0.0, -1.0); glVertex3f(0.0, 0.0, -1.0);
glVertex3f(0.0, 0.0, 1.0); glVertex3f(0.0, 0.0, 1.0);
glEnd();
// glPopMatrix(); vec3f posT, posP, posM;
m_constraint->worldFromB(vec3f(-1.f, 0.f, 0.f), posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(vec3f( 1.f, 0.f, 0.f), posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
m_constraint->worldFromB(vec3f( 0.f, -1.f, 0.f), posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(vec3f( 0.f, 1.f, 0.f), posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
m_constraint->worldFromB(vec3f( 0.f, 0.f, -1.f), posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(vec3f( 0.f, 0.f, 1.f), posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
glEnd();
glPopAttrib(); glPopAttrib();
view.endGL(); view.endGL();
@@ -321,11 +416,46 @@ void sixdofConstraintNode::computeConstraint(const MPlug& plug, MDataBlock& data
} }
} }
if(rigid_bodyA && rigid_bodyB) { vec3f pivInA, pivInB;
if((rigid_bodyA != NULL) && (rigid_bodyB != NULL))
{
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint);
float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
float3& mPivInB = data.inputValue(ia_pivotInB).asFloat3();
for(int i = 0; i < 3; i++)
{
pivInA[i] = (float)mPivInA[i];
pivInB[i] = (float)mPivInB[i];
}
float3& mRotInA = data.inputValue(ia_rotationInA).asFloat3();
MEulerRotation meulerA(deg2rad(mRotInA[0]), deg2rad(mRotInA[1]), deg2rad(mRotInA[2]));
MQuaternion mquatA = meulerA.asQuaternion();
quatf rotA((float)mquatA.w, (float)mquatA.x, (float)mquatA.y, (float)mquatA.z);
float3& mRotInB = data.inputValue(ia_rotationInB).asFloat3();
MEulerRotation meulerB(deg2rad(mRotInB[0]), deg2rad(mRotInB[1]), deg2rad(mRotInB[2]));
MQuaternion mquatB = meulerB.asQuaternion();
quatf rotB((float)mquatB.w, (float)mquatB.x, (float)mquatB.y, (float)mquatB.z);
m_constraint = solver_t::create_sixdof_constraint(rigid_bodyA, pivInA, rotA, rigid_bodyB, pivInB, rotB);
constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint);
}
else if(rigid_bodyA != NULL)
{
//not connected to a rigid body, put a default one //not connected to a rigid body, put a default one
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint); constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint); solver_t::remove_constraint(constraint);
m_constraint = solver_t::create_sixdof_constraint(rigid_bodyA, vec3f(), rigid_bodyB, vec3f()); float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
for(int i = 0; i < 3; i++)
{
pivInA[i] = (float)mPivInA[i];
}
float3& mRotInA = data.inputValue(ia_rotationInA).asFloat3();
MEulerRotation meuler(deg2rad(mRotInA[0]), deg2rad(mRotInA[1]), deg2rad(mRotInA[2]));
MQuaternion mquat = meuler.asQuaternion();
quatf rotA((float)mquat.w, (float)mquat.x, (float)mquat.y, (float)mquat.z);
m_constraint = solver_t::create_sixdof_constraint(rigid_bodyA, pivInA, rotA);
constraint = static_cast<constraint_t::pointer>(m_constraint); constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint); solver_t::add_constraint(constraint);
} }
@@ -337,8 +467,6 @@ void sixdofConstraintNode::computeConstraint(const MPlug& plug, MDataBlock& data
void sixdofConstraintNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data) void sixdofConstraintNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data)
{ {
// std::cout << "sixdofConstraintNode::computeWorldMatrix" << std::endl;
MObject thisObject(thisMObject()); MObject thisObject(thisMObject());
MFnDagNode fnDagNode(thisObject); MFnDagNode fnDagNode(thisObject);
@@ -346,31 +474,117 @@ void sixdofConstraintNode::computeWorldMatrix(const MPlug& plug, MDataBlock& dat
MPlug(thisObject, ca_constraint).getValue(update); MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update); MPlug(thisObject, ca_constraintParam).getValue(update);
MStatus status; MStatus status;
MFnTransform fnParentTransform(fnDagNode.parent(0, &status)); MFnTransform fnParentTransform(fnDagNode.parent(0, &status));
double fixScale[3] = { 1., 1., 1. }; // lock scale
fnParentTransform.setScale(fixScale);
MVector mtranslation = fnParentTransform.getTranslation(MSpace::kTransform, &status); MVector mtranslation = fnParentTransform.getTranslation(MSpace::kTransform, &status);
// MQuaternion mrotation; if(dSolverNode::isStartTime)
// fnParentTransform.getRotation(mrotation, MSpace::kTransform); { // allow to edit pivots
MPlug plgRigidBodyA(thisObject, ia_rigidBodyA);
if(m_constraint) { MPlug plgRigidBodyB(thisObject, ia_rigidBodyB);
vec3f world_pivot; MObject update;
m_constraint->get_world(world_pivot); //force evaluation of the rigidBody
if(world_pivot[0] != float(mtranslation.x) || plgRigidBodyA.getValue(update);
world_pivot[1] != float(mtranslation.y) || if(plgRigidBodyA.isConnected())
world_pivot[2] != float(mtranslation.z)) { {
MPlugArray connections;
// mat4x4f xform; plgRigidBodyA.connectedTo(connections, true, true);
// m_constraint->rigid_body()->get_transform(xform); if(connections.length() != 0)
// vec4f pivot = prod(trans(xform), vec4f(mtranslation.x, mtranslation.y, mtranslation.z, 1.0)); {
// m_constraint->set_pivot(vec3f(pivot[0], pivot[1], pivot[2])); MFnDependencyNode fnNode(connections[0].node());
m_constraint->set_world(vec3f((float) mtranslation[0], (float) mtranslation[1], (float) mtranslation[2])); if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbAObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeA = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbAObj, pRigidBodyNodeA->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
plgRigidBodyB.getValue(update);
if(plgRigidBodyB.isConnected())
{
MPlugArray connections;
plgRigidBodyB.connectedTo(connections, true, true);
if(connections.length() != 0)
{
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbBObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeB = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbBObj, pRigidBodyNodeB->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
if(m_constraint)
{
MQuaternion mrotation;
fnParentTransform.getRotation(mrotation, MSpace::kTransform);
bool doUpdatePivot = m_constraint->getPivotChanged();
if(!doUpdatePivot)
{
vec3f worldP;
quatf worldR;
m_constraint->get_world(worldP, worldR);
float deltaPX = worldP[0] - float(mtranslation.x);
float deltaPY = worldP[1] - float(mtranslation.y);
float deltaPZ = worldP[2] - float(mtranslation.z);
float deltaRX = (float)mrotation.x - worldR[1];
float deltaRY = (float)mrotation.y - worldR[2];
float deltaRZ = (float)mrotation.z - worldR[3];
float deltaRW = (float)mrotation.w - worldR[0];
float deltaSq = deltaPX * deltaPX + deltaPY * deltaPY + deltaPZ * deltaPZ
+ deltaRX * deltaRX + deltaRY * deltaRY + deltaRZ * deltaRZ + deltaRW * deltaRW;
doUpdatePivot = (deltaSq > FLT_EPSILON);
}
if(doUpdatePivot)
{
m_constraint->set_world(vec3f((float) mtranslation[0], (float) mtranslation[1], (float) mtranslation[2]),
quatf((float)mrotation.w, (float)mrotation.x, (float)mrotation.y, (float)mrotation.z));
vec3f pivInA, pivInB;
quatf rotInA, rotInB;
m_constraint->get_frameA(pivInA, rotInA);
m_constraint->get_frameB(pivInB, rotInB);
MDataHandle hPivInA = data.outputValue(ia_pivotInA);
float3 &ihPivInA = hPivInA.asFloat3();
MDataHandle hPivInB = data.outputValue(ia_pivotInB);
float3 &ihPivInB = hPivInB.asFloat3();
for(int i = 0; i < 3; i++)
{
ihPivInA[i] = pivInA[i];
ihPivInB[i] = pivInB[i];
}
MDataHandle hRotInA = data.outputValue(ia_rotationInA);
float3 &hrotInA = hRotInA.asFloat3();
MQuaternion mrotA(rotInA[1], rotInA[2], rotInA[3], rotInA[0]);
MEulerRotation newrotA(mrotA.asEulerRotation());
hrotInA[0] = rad2deg((float)newrotA.x);
hrotInA[1] = rad2deg((float)newrotA.y);
hrotInA[2] = rad2deg((float)newrotA.z);
MDataHandle hRotInB = data.outputValue(ia_rotationInB);
float3 &hrotInB = hRotInB.asFloat3();
MQuaternion mrotB(rotInB[1], rotInB[2], rotInB[3], rotInB[0]);
MEulerRotation newrotB(mrotB.asEulerRotation());
hrotInB[0] = rad2deg((float)newrotB.x);
hrotInB[1] = rad2deg((float)newrotB.y);
hrotInB[2] = rad2deg((float)newrotB.z);
m_constraint->setPivotChanged(false);
}
}
}
else
{ // if not start time, lock position and rotation
if(m_constraint)
{
vec3f worldP;
quatf worldR;
m_constraint->get_world(worldP, worldR);
fnParentTransform.setTranslation(MVector(worldP[0], worldP[1], worldP[2]), MSpace::kTransform);
fnParentTransform.setRotation(MQuaternion(worldR[1], worldR[2], worldR[3], worldR[0]));
} }
} }
data.setClean(plug); data.setClean(plug);
} }
@@ -384,12 +598,20 @@ void sixdofConstraintNode::computeConstraintParam(const MPlug& plug, MDataBlock&
MPlug(thisObject, ca_constraint).getValue(update); MPlug(thisObject, ca_constraint).getValue(update);
if(m_constraint) { if(m_constraint) {
m_constraint->set_damping((float) data.inputValue(ia_damping).asDouble()); m_constraint->set_damping((float) data.inputValue(ia_damping).asDouble());
float lin_lower = (float) data.inputValue(ia_lowerLinLimit).asDouble(); vec3f lowLin, uppLin, lowAng, uppAng;
float lin_upper = (float) data.inputValue(ia_upperLinLimit).asDouble(); float3& mLowLin = data.inputValue(ia_lowerLinLimit).asFloat3();
m_constraint->set_LinLimit(lin_lower, lin_upper); float3& mUppLin = data.inputValue(ia_upperLinLimit).asFloat3();
float ang_lower = (float) data.inputValue(ia_lowerAngLimit).asDouble(); float3& mLowAng = data.inputValue(ia_lowerAngLimit).asFloat3();
float ang_upper = (float) data.inputValue(ia_upperAngLimit).asDouble(); float3& mUppAng = data.inputValue(ia_upperAngLimit).asFloat3();
m_constraint->set_AngLimit(ang_lower, ang_upper); for(int j = 0; j < 3; j++)
{
lowLin[j] = mLowLin[j];
uppLin[j] = mUppLin[j];
lowAng[j] = deg2rad(mLowAng[j]);
uppAng[j] = deg2rad(mUppAng[j]);
}
m_constraint->set_LinLimit(lowLin, uppLin);
m_constraint->set_AngLimit(lowAng, uppAng);
} }
data.outputValue(ca_constraintParam).set(true); data.outputValue(ca_constraintParam).set(true);

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//sixdofConstraintNode.h //sixdofConstraintNode.h
@@ -62,6 +65,7 @@ public:
public: public:
sixdof_constraint_t::pointer constraint(); sixdof_constraint_t::pointer constraint();
void update();
public: public:
@@ -75,6 +79,13 @@ public:
static MObject ia_lowerAngLimit; static MObject ia_lowerAngLimit;
static MObject ia_upperAngLimit; static MObject ia_upperAngLimit;
static MObject ia_rotationInA;
static MObject ia_rotationInB;
static MObject ia_pivotInA;
static MObject ia_pivotInB;
static MObject ca_constraint; static MObject ca_constraint;
static MObject ca_constraintParam; static MObject ca_constraintParam;
@@ -83,7 +94,6 @@ public:
static MString typeName; static MString typeName;
private: private:
void update();
void computeConstraint(const MPlug& plug, MDataBlock& data); void computeConstraint(const MPlug& plug, MDataBlock& data);
void computeConstraintParam(const MPlug& plug, MDataBlock& data); void computeConstraintParam(const MPlug& plug, MDataBlock& data);
void computeWorldMatrix(const MPlug& plug, MDataBlock& data); void computeWorldMatrix(const MPlug& plug, MDataBlock& data);

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//sixdof_constraint.h //sixdof_constraint.h
@@ -42,25 +45,6 @@ public:
rigid_body_t::pointer rigid_bodyA() { return m_rigid_bodyA; } rigid_body_t::pointer rigid_bodyA() { return m_rigid_bodyA; }
rigid_body_t::pointer rigid_bodyB() { return m_rigid_bodyB; } rigid_body_t::pointer rigid_bodyB() { return m_rigid_bodyB; }
//
void set_pivot(vec3f const& p)
{
sixdof_constraint_impl_t* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t*>(impl());
sixdof_impl->set_pivot(p);
}
//local space pivot
void get_pivot(vec3f& p) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->get_pivot(p);
}
//
void get_world_pivot(vec3f& p) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->get_world_pivot(p);
}
// //
void set_damping(float d) { void set_damping(float d) {
sixdof_constraint_impl_t* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t*>(impl()); sixdof_constraint_impl_t* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t*>(impl());
@@ -72,33 +56,66 @@ public:
return sixdof_impl->damping(); return sixdof_impl->damping();
} }
void set_world(vec3f const& p) void set_LinLimit(vec3f& lower, vec3f& upper) {
{
sixdof_constraint_impl_t* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t*>(impl());
sixdof_impl->set_world(p);
}
//local space pivot
void get_world(vec3f& p) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->get_world(p);
}
void set_LinLimit(float lower, float upper) {
sixdof_constraint_impl_t* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t*>(impl()); sixdof_constraint_impl_t* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t*>(impl());
sixdof_impl->set_LinLimit(lower, upper); sixdof_impl->set_LinLimit(lower, upper);
} }
void set_AngLimit(float lower, float upper) { void set_AngLimit(vec3f& lower, vec3f& upper) {
sixdof_constraint_impl_t* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t*>(impl()); sixdof_constraint_impl_t* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t*>(impl());
sixdof_impl->set_AngLimit(lower, upper); sixdof_impl->set_AngLimit(lower, upper);
} }
void get_frameA(vec3f& p, quatf& r) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->get_frameA(p, r);
}
void get_frameB(vec3f& p, quatf& r) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->get_frameB(p, r);
}
void get_invFrameA(vec3f& p, quatf& r) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->get_invFrameA(p, r);
}
void get_invFrameB(vec3f& p, quatf& r) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->get_invFrameB(p, r);
}
void worldToA(vec3f& w, vec3f& p) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->worldToA(w, p);
}
void worldFromB(vec3f& p, vec3f& w) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->worldFromB(p, w);
}
void set_world(vec3f const& p, quatf const& r)
{
sixdof_constraint_impl_t* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t*>(impl());
sixdof_impl->set_world(p, r);
}
//local space pivot
void get_world(vec3f& p, quatf& r) const {
sixdof_constraint_impl_t const* sixdof_impl = dynamic_cast<sixdof_constraint_impl_t const*>(impl());
sixdof_impl->get_world(p, r);
}
public: public:
virtual ~sixdof_constraint_t() {}; virtual ~sixdof_constraint_t() {};
protected: protected:
friend class solver_t; friend class solver_t;
sixdof_constraint_t(sixdof_constraint_impl_t* impl, rigid_body_t::pointer& rigid_body):
constraint_t(impl),
m_rigid_bodyA(rigid_body)
{
}
sixdof_constraint_t(sixdof_constraint_impl_t* impl, rigid_body_t::pointer& rigid_bodyA, rigid_body_t::pointer& rigid_bodyB): sixdof_constraint_t(sixdof_constraint_impl_t* impl, rigid_body_t::pointer& rigid_bodyA, rigid_body_t::pointer& rigid_bodyB):
constraint_t(impl), constraint_t(impl),
m_rigid_bodyA(rigid_bodyA), m_rigid_bodyA(rigid_bodyA),

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//sixdof_constraint_impl.h //sixdof_constraint_impl.h
@@ -30,18 +33,20 @@ Written by: Herbert Law <Herbert.Law@gmail.com>
class sixdof_constraint_impl_t: public constraint_impl_t class sixdof_constraint_impl_t: public constraint_impl_t
{ {
public: public:
// virtual void set_world(vec3f const& p, quatf const& r) = 0;
virtual void set_pivot(vec3f const& p) = 0; virtual void get_world(vec3f& p, quatf& r) const = 0;
virtual void get_pivot(vec3f& p) const = 0; virtual void get_frameA(vec3f& p, quatf& r) const = 0;
virtual void get_world_pivot(vec3f& p) const = 0; virtual void get_frameB(vec3f& p, quatf& r) const = 0;
virtual void set_world(vec3f const& p) = 0; virtual void get_invFrameA(vec3f& p, quatf& r) const = 0;
virtual void get_world(vec3f& p) const = 0; virtual void get_invFrameB(vec3f& p, quatf& r) const = 0;
virtual void worldToA(vec3f& w, vec3f& p) const = 0;
virtual void worldFromB(vec3f& p, vec3f& w) const = 0;
// //
virtual void set_damping(float d) = 0; virtual void set_damping(float d) = 0;
virtual float damping() const = 0; virtual float damping() const = 0;
virtual void set_LinLimit(float lower, float upper) = 0; virtual void set_LinLimit(vec3f& lower, vec3f& upper) = 0;
virtual void set_AngLimit(float lower, float upper) = 0; virtual void set_AngLimit(vec3f& lower, vec3f& upper) = 0;
public: public:
virtual ~sixdof_constraint_impl_t() {}; virtual ~sixdof_constraint_impl_t() {};

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//sliderConstraintNode.cpp //sliderConstraintNode.cpp
@@ -39,6 +42,8 @@ Written by: Herbert Law <Herbert.Law@gmail.com>
#include "mayaUtils.h" #include "mayaUtils.h"
#include "solver.h" #include "solver.h"
#include "dSolverNode.h"
#include "constraint/bt_slider_constraint.h"
MTypeId sliderConstraintNode::typeId(0x100385); MTypeId sliderConstraintNode::typeId(0x100385);
MString sliderConstraintNode::typeName("dSliderConstraint"); MString sliderConstraintNode::typeName("dSliderConstraint");
@@ -52,6 +57,10 @@ MObject sliderConstraintNode::ia_lowerLinLimit;
MObject sliderConstraintNode::ia_upperLinLimit; MObject sliderConstraintNode::ia_upperLinLimit;
MObject sliderConstraintNode::ia_lowerAngLimit; MObject sliderConstraintNode::ia_lowerAngLimit;
MObject sliderConstraintNode::ia_upperAngLimit; MObject sliderConstraintNode::ia_upperAngLimit;
MObject sliderConstraintNode::ia_rotationInA;
MObject sliderConstraintNode::ia_rotationInB;
MObject sliderConstraintNode::ia_pivotInA;
MObject sliderConstraintNode::ia_pivotInB;
MStatus sliderConstraintNode::initialize() MStatus sliderConstraintNode::initialize()
{ {
@@ -119,6 +128,31 @@ MStatus sliderConstraintNode::initialize()
MCHECKSTATUS(status, "adding ca_constraintParam attribute") MCHECKSTATUS(status, "adding ca_constraintParam attribute")
ia_rotationInA = fnNumericAttr.createPoint("rotationInA", "hgRotA", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating rotationInA attribute")
status = addAttribute(ia_rotationInA);
MCHECKSTATUS(status, "adding rotationInA attribute")
ia_rotationInB = fnNumericAttr.createPoint("rotationInB", "hgRotB", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating rotationInB attribute")
status = addAttribute(ia_rotationInB);
MCHECKSTATUS(status, "adding rotationInB attribute")
ia_pivotInA = fnNumericAttr.createPoint("pivotInA", "pivinA", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating pivotInA attribute")
status = addAttribute(ia_pivotInA);
MCHECKSTATUS(status, "adding pivotInA attribute")
ia_pivotInB = fnNumericAttr.createPoint("pivotInB", "pivinB", &status);
status = fnNumericAttr.setDefault((double) 0.0, (double) 0.0, (double) 0.0);
MCHECKSTATUS(status, "creating pivotInB attribute")
status = addAttribute(ia_pivotInB);
MCHECKSTATUS(status, "adding pivotInB attribute")
status = attributeAffects(ia_rigidBodyA, ca_constraint); status = attributeAffects(ia_rigidBodyA, ca_constraint);
MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyA, ca_constraint)") MCHECKSTATUS(status, "adding attributeAffects(ia_rigidBodyA, ca_constraint)")
@@ -146,6 +180,17 @@ MStatus sliderConstraintNode::initialize()
status = attributeAffects(ia_upperAngLimit, ca_constraintParam); status = attributeAffects(ia_upperAngLimit, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_upperAngLimit, ca_constraintParam)") MCHECKSTATUS(status, "adding attributeAffects(ia_upperAngLimit, ca_constraintParam)")
status = attributeAffects(ia_rotationInA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rotationInA, ca_constraintParam)")
status = attributeAffects(ia_rotationInB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_rotationInB, ca_constraintParam)")
status = attributeAffects(ia_pivotInA, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInA, ca_constraintParam)")
status = attributeAffects(ia_pivotInB, ca_constraintParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_pivotInB, ca_constraintParam)")
return MS::kSuccess; return MS::kSuccess;
} }
@@ -164,6 +209,20 @@ void sliderConstraintNode::nodeRemoved(MObject& node, void *clientData)
// std::cout << "sliderConstraintNode::nodeRemoved" << std::endl; // std::cout << "sliderConstraintNode::nodeRemoved" << std::endl;
MFnDependencyNode fnNode(node); MFnDependencyNode fnNode(node);
sliderConstraintNode *pNode = static_cast<sliderConstraintNode*>(fnNode.userNode()); sliderConstraintNode *pNode = static_cast<sliderConstraintNode*>(fnNode.userNode());
if (pNode->m_constraint)
{
bt_slider_constraint_t* hinge_impl = dynamic_cast<bt_slider_constraint_t*>(pNode->m_constraint->pubImpl());
rigid_body_t::pointer rigid_bodyA = pNode->m_constraint->rigid_bodyA();
if(rigid_bodyA)
{
rigid_bodyA->remove_constraint(hinge_impl);
}
rigid_body_t::pointer rigid_bodyB = pNode->m_constraint->rigid_bodyB();
if(rigid_bodyB)
{
rigid_bodyB->remove_constraint(hinge_impl);
}
}
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(pNode->m_constraint); constraint_t::pointer constraint = static_cast<constraint_t::pointer>(pNode->m_constraint);
solver_t::remove_constraint(constraint); solver_t::remove_constraint(constraint);
} }
@@ -210,14 +269,11 @@ void sliderConstraintNode::draw( M3dView & view, const MDagPath &path,
M3dView::DisplayStyle style, M3dView::DisplayStyle style,
M3dView::DisplayStatus status ) M3dView::DisplayStatus status )
{ {
// std::cout << "sliderConstraintNode::draw" << std::endl;
update(); update();
view.beginGL(); view.beginGL();
glPushAttrib( GL_ALL_ATTRIB_BITS ); glPushAttrib( GL_ALL_ATTRIB_BITS );
// glPushMatrix();
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
if( !(status == M3dView::kActive || if( !(status == M3dView::kActive ||
@@ -227,23 +283,37 @@ void sliderConstraintNode::draw( M3dView & view, const MDagPath &path,
glColor3f(1.0, 1.0, 0.0); glColor3f(1.0, 1.0, 0.0);
} }
vec3f posA; vec3f posA, posB, pivB;
vec3f posB; rigid_body_t::pointer rigid_bodyB = NULL;
if (m_constraint) { if (m_constraint)
vec3f world; {
m_constraint->get_world(world); vec3f pos;
quatf rotA; quatf rot;
m_constraint->rigid_bodyA()->get_transform(posA, rotA); m_constraint->rigid_bodyA()->get_transform(pos, rot);
posA = posA - world; m_constraint->worldToA(pos, posA);
quatf rotB; rigid_bodyB = m_constraint->rigid_bodyB();
m_constraint->rigid_bodyB()->get_transform(posB, rotB); if(rigid_bodyB)
posB = posB - world; {
rigid_bodyB->get_transform(pos, rot);
m_constraint->worldToA(pos, posB);
}
m_constraint->worldFromB(vec3f(0.f, 0.f, 0.f), pos);
m_constraint->worldToA(pos, pivB);
} }
// glLoadIdentity();
glBegin(GL_LINES); glBegin(GL_LINES);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(posA[0], posA[1], posA[2]); glVertex3f(posA[0], posA[1], posA[2]);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(pivB[0], pivB[1], pivB[2]);
if(rigid_bodyB)
{
glVertex3f(pivB[0], pivB[1], pivB[2]);
glVertex3f(posB[0], posB[1], posB[2]); glVertex3f(posB[0], posB[1], posB[2]);
}
glVertex3f(-1.0, 0.0, 0.0); glVertex3f(-1.0, 0.0, 0.0);
glVertex3f(1.0, 0.0, 0.0); glVertex3f(1.0, 0.0, 0.0);
@@ -253,9 +323,30 @@ void sliderConstraintNode::draw( M3dView & view, const MDagPath &path,
glVertex3f(0.0, 0.0, -1.0); glVertex3f(0.0, 0.0, -1.0);
glVertex3f(0.0, 0.0, 1.0); glVertex3f(0.0, 0.0, 1.0);
glEnd();
// glPopMatrix(); vec3f posT, posP, posM;
m_constraint->worldFromB(vec3f(-1.f, 0.f, 0.f), posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(vec3f( 1.f, 0.f, 0.f), posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
m_constraint->worldFromB(vec3f( 0.f, -1.f, 0.f), posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(vec3f( 0.f, 1.f, 0.f), posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
m_constraint->worldFromB(vec3f( 0.f, 0.f, -1.f), posT);
m_constraint->worldToA(posT, posM);
m_constraint->worldFromB(vec3f( 0.f, 0.f, 1.f), posT);
m_constraint->worldToA(posT, posP);
glVertex3f(posM[0], posM[1], posM[2]);
glVertex3f(posP[0], posP[1], posP[2]);
glEnd();
glPopAttrib(); glPopAttrib();
view.endGL(); view.endGL();
@@ -321,15 +412,49 @@ void sliderConstraintNode::computeConstraint(const MPlug& plug, MDataBlock& data
} }
} }
if(rigid_bodyA && rigid_bodyB) { vec3f pivInA, pivInB;
//not connected to a rigid body, put a default one
if((rigid_bodyA != NULL) && (rigid_bodyB != NULL))
{
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint); constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint); solver_t::remove_constraint(constraint);
m_constraint = solver_t::create_slider_constraint(rigid_bodyA, vec3f(), rigid_bodyB, vec3f()); float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
float3& mPivInB = data.inputValue(ia_pivotInB).asFloat3();
for(int i = 0; i < 3; i++)
{
pivInA[i] = (float)mPivInA[i];
pivInB[i] = (float)mPivInB[i];
}
float3& mRotInA = data.inputValue(ia_rotationInA).asFloat3();
MEulerRotation meulerA(deg2rad(mRotInA[0]), deg2rad(mRotInA[1]), deg2rad(mRotInA[2]));
MQuaternion mquatA = meulerA.asQuaternion();
quatf rotA((float)mquatA.w, (float)mquatA.x, (float)mquatA.y, (float)mquatA.z);
float3& mRotInB = data.inputValue(ia_rotationInB).asFloat3();
MEulerRotation meulerB(deg2rad(mRotInB[0]), deg2rad(mRotInB[1]), deg2rad(mRotInB[2]));
MQuaternion mquatB = meulerB.asQuaternion();
quatf rotB((float)mquatB.w, (float)mquatB.x, (float)mquatB.y, (float)mquatB.z);
m_constraint = solver_t::create_slider_constraint(rigid_bodyA, pivInA, rotA, rigid_bodyB, pivInB, rotB);
constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint);
}
else if(rigid_bodyA != NULL)
{
//not connected to a rigid body, put a default one
constraint_t::pointer constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::remove_constraint(constraint);
float3& mPivInA = data.inputValue(ia_pivotInA).asFloat3();
for(int i = 0; i < 3; i++)
{
pivInA[i] = (float)mPivInA[i];
}
float3& mRotInA = data.inputValue(ia_rotationInA).asFloat3();
MEulerRotation meuler(deg2rad(mRotInA[0]), deg2rad(mRotInA[1]), deg2rad(mRotInA[2]));
MQuaternion mquat = meuler.asQuaternion();
quatf rotA((float)mquat.w, (float)mquat.x, (float)mquat.y, (float)mquat.z);
m_constraint = solver_t::create_slider_constraint(rigid_bodyA, pivInA, rotA);
constraint = static_cast<constraint_t::pointer>(m_constraint); constraint = static_cast<constraint_t::pointer>(m_constraint);
solver_t::add_constraint(constraint); solver_t::add_constraint(constraint);
} }
data.outputValue(ca_constraint).set(true); data.outputValue(ca_constraint).set(true);
data.setClean(plug); data.setClean(plug);
} }
@@ -337,8 +462,6 @@ void sliderConstraintNode::computeConstraint(const MPlug& plug, MDataBlock& data
void sliderConstraintNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data) void sliderConstraintNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data)
{ {
// std::cout << "sliderConstraintNode::computeWorldMatrix" << std::endl;
MObject thisObject(thisMObject()); MObject thisObject(thisMObject());
MFnDagNode fnDagNode(thisObject); MFnDagNode fnDagNode(thisObject);
@@ -346,31 +469,117 @@ void sliderConstraintNode::computeWorldMatrix(const MPlug& plug, MDataBlock& dat
MPlug(thisObject, ca_constraint).getValue(update); MPlug(thisObject, ca_constraint).getValue(update);
MPlug(thisObject, ca_constraintParam).getValue(update); MPlug(thisObject, ca_constraintParam).getValue(update);
MStatus status; MStatus status;
MFnTransform fnParentTransform(fnDagNode.parent(0, &status)); MFnTransform fnParentTransform(fnDagNode.parent(0, &status));
double fixScale[3] = { 1., 1., 1. }; // lock scale
fnParentTransform.setScale(fixScale);
MVector mtranslation = fnParentTransform.getTranslation(MSpace::kTransform, &status); MVector mtranslation = fnParentTransform.getTranslation(MSpace::kTransform, &status);
// MQuaternion mrotation; if(dSolverNode::isStartTime)
// fnParentTransform.getRotation(mrotation, MSpace::kTransform); { // allow to edit pivots
MPlug plgRigidBodyA(thisObject, ia_rigidBodyA);
if(m_constraint) { MPlug plgRigidBodyB(thisObject, ia_rigidBodyB);
vec3f world_pivot; MObject update;
m_constraint->get_world(world_pivot); //force evaluation of the rigidBody
if(world_pivot[0] != float(mtranslation.x) || plgRigidBodyA.getValue(update);
world_pivot[1] != float(mtranslation.y) || if(plgRigidBodyA.isConnected())
world_pivot[2] != float(mtranslation.z)) { {
MPlugArray connections;
// mat4x4f xform; plgRigidBodyA.connectedTo(connections, true, true);
// m_constraint->rigid_body()->get_transform(xform); if(connections.length() != 0)
// vec4f pivot = prod(trans(xform), vec4f(mtranslation.x, mtranslation.y, mtranslation.z, 1.0)); {
// m_constraint->set_pivot(vec3f(pivot[0], pivot[1], pivot[2])); MFnDependencyNode fnNode(connections[0].node());
m_constraint->set_world(vec3f((float) mtranslation[0], (float) mtranslation[1], (float) mtranslation[2])); if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbAObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeA = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbAObj, pRigidBodyNodeA->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
plgRigidBodyB.getValue(update);
if(plgRigidBodyB.isConnected())
{
MPlugArray connections;
plgRigidBodyB.connectedTo(connections, true, true);
if(connections.length() != 0)
{
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == rigidBodyNode::typeId)
{
MObject rbBObj = fnNode.object();
rigidBodyNode *pRigidBodyNodeB = static_cast<rigidBodyNode*>(fnNode.userNode());
MPlug(rbBObj, pRigidBodyNodeB->worldMatrix).elementByLogicalIndex(0).getValue(update);
}
}
}
if(m_constraint)
{
MQuaternion mrotation;
fnParentTransform.getRotation(mrotation, MSpace::kTransform);
bool doUpdatePivot = m_constraint->getPivotChanged();
if(!doUpdatePivot)
{
vec3f worldP;
quatf worldR;
m_constraint->get_world(worldP, worldR);
float deltaPX = worldP[0] - float(mtranslation.x);
float deltaPY = worldP[1] - float(mtranslation.y);
float deltaPZ = worldP[2] - float(mtranslation.z);
float deltaRX = (float)mrotation.x - worldR[1];
float deltaRY = (float)mrotation.y - worldR[2];
float deltaRZ = (float)mrotation.z - worldR[3];
float deltaRW = (float)mrotation.w - worldR[0];
float deltaSq = deltaPX * deltaPX + deltaPY * deltaPY + deltaPZ * deltaPZ
+ deltaRX * deltaRX + deltaRY * deltaRY + deltaRZ * deltaRZ + deltaRW * deltaRW;
doUpdatePivot = (deltaSq > FLT_EPSILON);
}
if(doUpdatePivot)
{
m_constraint->set_world(vec3f((float) mtranslation[0], (float) mtranslation[1], (float) mtranslation[2]),
quatf((float)mrotation.w, (float)mrotation.x, (float)mrotation.y, (float)mrotation.z));
vec3f pivInA, pivInB;
quatf rotInA, rotInB;
m_constraint->get_frameA(pivInA, rotInA);
m_constraint->get_frameB(pivInB, rotInB);
MDataHandle hPivInA = data.outputValue(ia_pivotInA);
float3 &ihPivInA = hPivInA.asFloat3();
MDataHandle hPivInB = data.outputValue(ia_pivotInB);
float3 &ihPivInB = hPivInB.asFloat3();
for(int i = 0; i < 3; i++)
{
ihPivInA[i] = pivInA[i];
ihPivInB[i] = pivInB[i];
}
MDataHandle hRotInA = data.outputValue(ia_rotationInA);
float3 &hrotInA = hRotInA.asFloat3();
MQuaternion mrotA(rotInA[1], rotInA[2], rotInA[3], rotInA[0]);
MEulerRotation newrotA(mrotA.asEulerRotation());
hrotInA[0] = rad2deg((float)newrotA.x);
hrotInA[1] = rad2deg((float)newrotA.y);
hrotInA[2] = rad2deg((float)newrotA.z);
MDataHandle hRotInB = data.outputValue(ia_rotationInB);
float3 &hrotInB = hRotInB.asFloat3();
MQuaternion mrotB(rotInB[1], rotInB[2], rotInB[3], rotInB[0]);
MEulerRotation newrotB(mrotB.asEulerRotation());
hrotInB[0] = rad2deg((float)newrotB.x);
hrotInB[1] = rad2deg((float)newrotB.y);
hrotInB[2] = rad2deg((float)newrotB.z);
m_constraint->setPivotChanged(false);
}
}
}
else
{ // if not start time, lock position and rotation
if(m_constraint)
{
vec3f worldP;
quatf worldR;
m_constraint->get_world(worldP, worldR);
fnParentTransform.setTranslation(MVector(worldP[0], worldP[1], worldP[2]), MSpace::kTransform);
fnParentTransform.setRotation(MQuaternion(worldR[1], worldR[2], worldR[3], worldR[0]));
} }
} }
data.setClean(plug); data.setClean(plug);
} }
@@ -389,7 +598,7 @@ void sliderConstraintNode::computeConstraintParam(const MPlug& plug, MDataBlock&
m_constraint->set_LinLimit(lin_lower, lin_upper); m_constraint->set_LinLimit(lin_lower, lin_upper);
float ang_lower = (float) data.inputValue(ia_lowerAngLimit).asDouble(); float ang_lower = (float) data.inputValue(ia_lowerAngLimit).asDouble();
float ang_upper = (float) data.inputValue(ia_upperAngLimit).asDouble(); float ang_upper = (float) data.inputValue(ia_upperAngLimit).asDouble();
m_constraint->set_AngLimit(ang_lower, ang_upper); m_constraint->set_AngLimit(deg2rad(ang_lower), deg2rad(ang_upper));
} }
data.outputValue(ca_constraintParam).set(true); data.outputValue(ca_constraintParam).set(true);

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//sliderConstraintNode.h //sliderConstraintNode.h
@@ -62,6 +65,7 @@ public:
public: public:
slider_constraint_t::pointer constraint(); slider_constraint_t::pointer constraint();
void update();
public: public:
@@ -75,6 +79,13 @@ public:
static MObject ia_lowerAngLimit; static MObject ia_lowerAngLimit;
static MObject ia_upperAngLimit; static MObject ia_upperAngLimit;
static MObject ia_rotationInA;
static MObject ia_rotationInB;
static MObject ia_pivotInA;
static MObject ia_pivotInB;
static MObject ca_constraint; static MObject ca_constraint;
static MObject ca_constraintParam; static MObject ca_constraintParam;
@@ -83,7 +94,6 @@ public:
static MString typeName; static MString typeName;
private: private:
void update();
void computeConstraint(const MPlug& plug, MDataBlock& data); void computeConstraint(const MPlug& plug, MDataBlock& data);
void computeConstraintParam(const MPlug& plug, MDataBlock& data); void computeConstraintParam(const MPlug& plug, MDataBlock& data);
void computeWorldMatrix(const MPlug& plug, MDataBlock& data); void computeWorldMatrix(const MPlug& plug, MDataBlock& data);

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//slider_constraint.h //slider_constraint.h
@@ -42,24 +45,6 @@ public:
rigid_body_t::pointer rigid_bodyA() { return m_rigid_bodyA; } rigid_body_t::pointer rigid_bodyA() { return m_rigid_bodyA; }
rigid_body_t::pointer rigid_bodyB() { return m_rigid_bodyB; } rigid_body_t::pointer rigid_bodyB() { return m_rigid_bodyB; }
//
void set_pivot(vec3f const& p)
{
slider_constraint_impl_t* slider_impl = dynamic_cast<slider_constraint_impl_t*>(impl());
slider_impl->set_pivot(p);
}
//local space pivot
void get_pivot(vec3f& p) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->get_pivot(p);
}
//
void get_world_pivot(vec3f& p) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->get_world_pivot(p);
}
// //
void set_damping(float d) { void set_damping(float d) {
@@ -72,17 +57,6 @@ public:
return slider_impl->damping(); return slider_impl->damping();
} }
void set_world(vec3f const& p)
{
slider_constraint_impl_t* slider_impl = dynamic_cast<slider_constraint_impl_t*>(impl());
slider_impl->set_world(p);
}
//local space pivot
void get_world(vec3f& p) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->get_world(p);
}
void set_LinLimit(float lower, float upper) { void set_LinLimit(float lower, float upper) {
slider_constraint_impl_t* slider_impl = dynamic_cast<slider_constraint_impl_t*>(impl()); slider_constraint_impl_t* slider_impl = dynamic_cast<slider_constraint_impl_t*>(impl());
@@ -94,11 +68,54 @@ public:
slider_impl->set_AngLimit(lower, upper); slider_impl->set_AngLimit(lower, upper);
} }
void get_frameA(vec3f& p, quatf& r) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->get_frameA(p, r);
}
void get_frameB(vec3f& p, quatf& r) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->get_frameB(p, r);
}
void get_invFrameA(vec3f& p, quatf& r) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->get_invFrameA(p, r);
}
void get_invFrameB(vec3f& p, quatf& r) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->get_invFrameB(p, r);
}
void worldToA(vec3f& w, vec3f& p) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->worldToA(w, p);
}
void worldFromB(vec3f& p, vec3f& w) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->worldFromB(p, w);
}
void set_world(vec3f const& p, quatf const& r)
{
slider_constraint_impl_t* slider_impl = dynamic_cast<slider_constraint_impl_t*>(impl());
slider_impl->set_world(p, r);
}
//local space pivot
void get_world(vec3f& p, quatf& r) const {
slider_constraint_impl_t const* slider_impl = dynamic_cast<slider_constraint_impl_t const*>(impl());
slider_impl->get_world(p, r);
}
public: public:
virtual ~slider_constraint_t() {}; virtual ~slider_constraint_t() {};
protected: protected:
friend class solver_t; friend class solver_t;
slider_constraint_t(slider_constraint_impl_t* impl, rigid_body_t::pointer& rigid_body):
constraint_t(impl),
m_rigid_bodyA(rigid_body)
{
}
slider_constraint_t(slider_constraint_impl_t* impl, rigid_body_t::pointer& rigid_bodyA, rigid_body_t::pointer& rigid_bodyB): slider_constraint_t(slider_constraint_impl_t* impl, rigid_body_t::pointer& rigid_bodyA, rigid_body_t::pointer& rigid_bodyB):
constraint_t(impl), constraint_t(impl),
m_rigid_bodyA(rigid_bodyA), m_rigid_bodyA(rigid_bodyA),

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//slider_constraint_impl.h //slider_constraint_impl.h
@@ -31,11 +34,14 @@ class slider_constraint_impl_t: public constraint_impl_t
{ {
public: public:
// //
virtual void set_pivot(vec3f const& p) = 0; virtual void set_world(vec3f const& p, quatf const& r) = 0;
virtual void get_pivot(vec3f& p) const = 0; virtual void get_world(vec3f& p, quatf& r) const = 0;
virtual void get_world_pivot(vec3f& p) const = 0; virtual void get_frameA(vec3f& p, quatf& r) const = 0;
virtual void set_world(vec3f const& p) = 0; virtual void get_frameB(vec3f& p, quatf& r) const = 0;
virtual void get_world(vec3f& p) const = 0; virtual void get_invFrameA(vec3f& p, quatf& r) const = 0;
virtual void get_invFrameB(vec3f& p, quatf& r) const = 0;
virtual void worldToA(vec3f& w, vec3f& p) const = 0;
virtual void worldFromB(vec3f& p, vec3f& w) const = 0;
// //
virtual void set_damping(float d) = 0; virtual void set_damping(float d) = 0;

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//dSolverNode.cpp //dSolverNode.cpp
@@ -44,6 +43,10 @@ Modified by Roman Ponomarev <rponom@gmail.com>
#include <maya/MVectorArray.h> #include <maya/MVectorArray.h>
#include <maya/MItDag.h> #include <maya/MItDag.h>
#include <maya/MConditionMessage.h> #include <maya/MConditionMessage.h>
#include <maya/MDGModifier.h>
#include <maya/MDGMessage.h>
#include <maya/MDagPath.h>
#include <maya/MSceneMessage.h>
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
@@ -54,7 +57,11 @@ Modified by Roman Ponomarev <rponom@gmail.com>
#include "rigidBodyNode.h" #include "rigidBodyNode.h"
#include "rigidBodyArrayNode.h" #include "rigidBodyArrayNode.h"
#include "constraint/nailConstraintNode.h" #include "constraint/nailConstraintNode.h"
#include "constraint/hingeConstraintNode.h"
#include "constraint/sliderConstraintNode.h"
#include "constraint/sixdofConstraintNode.h"
#include "pdbIO.h" #include "pdbIO.h"
#include "collisionShapeNode.h"
MTypeId dSolverNode::typeId(0x100331); MTypeId dSolverNode::typeId(0x100331);
MString dSolverNode::typeName("dSolver"); MString dSolverNode::typeName("dSolver");
@@ -67,6 +74,8 @@ MObject dSolverNode::ia_splitImpulse;
MObject dSolverNode::ia_substeps; MObject dSolverNode::ia_substeps;
MObject dSolverNode::oa_rigidBodies; MObject dSolverNode::oa_rigidBodies;
MObject dSolverNode::ssSolverType; MObject dSolverNode::ssSolverType;
bool dSolverNode::isStartTime;
#define ATTR_POSITION "position" #define ATTR_POSITION "position"
//#define ATTR_POSITION_TYPE VECTOR_ATTR //#define ATTR_POSITION_TYPE VECTOR_ATTR
@@ -85,6 +94,162 @@ MObject dSolverNode::ssSolverType;
//#define ATTR_IN_RANGLENEXT_TYPE FLOAT_ATTR //#define ATTR_IN_RANGLENEXT_TYPE FLOAT_ATTR
static void sceneLoadedCB(void* clientData)
{
dSolverNode::updateAllRigidBodies();
}
#if 0
static void connCB( MPlug & srcPlug, MPlug & destPlug, bool made, void* clientData)
{
static int numConn = 0;
MObject objSrc = srcPlug.node();
MObject objDst = destPlug.node();
MFnDependencyNode fnNodeSrc(objSrc);
MFnDependencyNode fnNodeDst(objDst);
if(fnNodeSrc.typeId() == collisionShapeNode::typeId)
{
if(fnNodeDst.typeId() == rigidBodyNode::typeId)
{
numConn++;
}
}
if(fnNodeDst.typeId() == collisionShapeNode::typeId)
{
if(fnNodeSrc.typeId() == rigidBodyNode::typeId)
{
numConn++;
}
}
}
#endif
static void updateSceneCB(MTime & time, void* clientData)
{
dSolverNode::updateAllRigidBodies();
}
void dSolverNode::updateAllRigidBodies()
{
MStatus stat;
// MItDag dagIterator( MItDag::kBreadthFirst, MFn::kInvalid, &stat);
MItDag dagIterator( MItDag::kDepthFirst, MFn::kInvalid, &stat);
if (stat != MS::kSuccess)
{
std::cout << "Failure in DAG iterator setup" << std::endl;
return;
}
for ( ;!dagIterator.isDone(); dagIterator.next())
{
MDagPath dagPath;
stat = dagIterator.getPath( dagPath );
if(stat != MS::kSuccess)
{
std::cout << "Failure in getting DAG path" << std::endl;
return;
}
// skip over intermediate objects
MFnDagNode dagNode( dagPath, &stat );
if (dagNode.isIntermediateObject())
{
continue;
}
if(!dagPath.hasFn(MFn::kDependencyNode))
{
continue;
}
MObject mObj = dagNode.object(&stat);
if(stat != MS::kSuccess)
{
std::cout << "Failure in getting MObject" << std::endl;
return;
}
MFnDependencyNode fnNode(mObj, &stat);
if(stat != MS::kSuccess)
{
std::cout << "Failure in getting dependency node" << std::endl;
return;
}
if(fnNode.typeId() == rigidBodyNode::typeId)
{
MPlug plgCollisionShape(mObj, rigidBodyNode::ia_collisionShape);
MObject update;
//force evaluation of the shape
plgCollisionShape.getValue(update);
if(plgCollisionShape.isConnected())
{
rigidBodyNode *rbNode = static_cast<rigidBodyNode*>(dagNode.userNode());
rbNode->update();
}
}
if(fnNode.typeId() == nailConstraintNode::typeId)
{
MPlug plgRbA(mObj, nailConstraintNode::ia_rigidBodyA);
MPlug plgRbB(mObj, nailConstraintNode::ia_rigidBodyB);
MObject update;
//force evaluation
plgRbA.getValue(update);
plgRbB.getValue(update);
bool connA = plgRbA.isConnected();
bool connB = plgRbB.isConnected();
if(connA || connB)
{
nailConstraintNode *ncNode = static_cast<nailConstraintNode*>(dagNode.userNode());
ncNode->update();
}
}
if(fnNode.typeId() == hingeConstraintNode::typeId)
{
MPlug plgRbA(mObj, hingeConstraintNode::ia_rigidBodyA);
MPlug plgRbB(mObj, hingeConstraintNode::ia_rigidBodyB);
MObject update;
//force evaluation
plgRbA.getValue(update);
plgRbB.getValue(update);
bool connA = plgRbA.isConnected();
bool connB = plgRbB.isConnected();
if(connA || connB)
{
hingeConstraintNode *hcNode = static_cast<hingeConstraintNode*>(dagNode.userNode());
hcNode->update();
}
}
if(fnNode.typeId() == sliderConstraintNode::typeId)
{
MPlug plgRbA(mObj, hingeConstraintNode::ia_rigidBodyA);
MPlug plgRbB(mObj, hingeConstraintNode::ia_rigidBodyB);
MObject update;
//force evaluation
plgRbA.getValue(update);
plgRbB.getValue(update);
bool connA = plgRbA.isConnected();
bool connB = plgRbB.isConnected();
if(connA || connB)
{
sliderConstraintNode *scNode = static_cast<sliderConstraintNode*>(dagNode.userNode());
scNode->update();
}
}
if(fnNode.typeId() == sixdofConstraintNode::typeId)
{
MPlug plgRbA(mObj, hingeConstraintNode::ia_rigidBodyA);
MPlug plgRbB(mObj, hingeConstraintNode::ia_rigidBodyB);
MObject update;
//force evaluation
plgRbA.getValue(update);
plgRbB.getValue(update);
bool connA = plgRbA.isConnected();
bool connB = plgRbB.isConnected();
if(connA || connB)
{
sixdofConstraintNode *sdNode = static_cast<sixdofConstraintNode*>(dagNode.userNode());
sdNode->update();
}
}
}
}
MStatus dSolverNode::initialize() MStatus dSolverNode::initialize()
{ {
@@ -94,6 +259,10 @@ MStatus dSolverNode::initialize()
MFnUnitAttribute fnUnitAttr; MFnUnitAttribute fnUnitAttr;
MFnNumericAttribute fnNumericAttr; MFnNumericAttribute fnNumericAttr;
MCallbackId updateSceneCBId = MDGMessage::addForceUpdateCallback(updateSceneCB, NULL, NULL );
MCallbackId sceneLoadedCBId = MSceneMessage::addCallback(MSceneMessage::kAfterOpen, sceneLoadedCB, NULL, NULL);
// MCallbackId connCBId = MDGMessage::addConnectionCallback(connCB, NULL, NULL );
// //
ssSolverType = fnEnumAttr.create( "ssSolverType", "ssst", 0, &status ); ssSolverType = fnEnumAttr.create( "ssSolverType", "ssst", 0, &status );
MCHECKSTATUS(status, "creating ssSolverType attribute") MCHECKSTATUS(status, "creating ssSolverType attribute")
@@ -176,6 +345,7 @@ bool dSolverNode::setInternalValueInContext( const MPlug & plug, const MDataHa
return false; return false;
} }
MStatus dSolverNode::compute(const MPlug& plug, MDataBlock& data) MStatus dSolverNode::compute(const MPlug& plug, MDataBlock& data)
{ {
if(plug == oa_rigidBodies) { if(plug == oa_rigidBodies) {
@@ -203,7 +373,8 @@ void initRigidBody(MObject &node)
MPlug plgMass(node, rigidBodyNode::ia_mass); MPlug plgMass(node, rigidBodyNode::ia_mass);
float mass = 0.f; float mass = 0.f;
plgMass.getValue(mass); plgMass.getValue(mass);
if(mass>0.f) { if(mass > 0.f)
{
//active rigid body, set the world transform from the initial* attributes //active rigid body, set the world transform from the initial* attributes
MObject obj; MObject obj;
@@ -233,7 +404,7 @@ void initRigidBody(MObject &node)
MEulerRotation meuler(deg2rad(rot[0]), deg2rad(rot[1]), deg2rad(rot[2])); MEulerRotation meuler(deg2rad(rot[0]), deg2rad(rot[1]), deg2rad(rot[2]));
MQuaternion mquat = meuler.asQuaternion(); MQuaternion mquat = meuler.asQuaternion();
rb->set_transform(pos, quatf(mquat.w, mquat.x, mquat.y, mquat.z)); rb->set_transform(pos, quatf((float)mquat.w, (float)mquat.x, (float)mquat.y, (float)mquat.z));
rb->set_linear_velocity(vel); rb->set_linear_velocity(vel);
rb->set_angular_velocity(spin); rb->set_angular_velocity(spin);
rb->set_kinematic(false); rb->set_kinematic(false);
@@ -245,7 +416,8 @@ void initRigidBody(MObject &node)
MQuaternion mquat; MQuaternion mquat;
fnTransform.getRotation(mquat); fnTransform.getRotation(mquat);
MVector mpos(fnTransform.getTranslation(MSpace::kTransform)); MVector mpos(fnTransform.getTranslation(MSpace::kTransform));
rb->set_transform(vec3f(mpos.x, mpos.y, mpos.z), quatf(mquat.w, mquat.x, mquat.y, mquat.z)); rb->set_transform(vec3f((float)mpos.x, (float)mpos.y, (float)mpos.z), quatf((float)mquat.w, (float)mquat.x, (float)mquat.y, (float)mquat.z));
rb->set_interpolation_transform(vec3f((float)mpos.x, (float)mpos.y, (float)mpos.z), quatf((float)mquat.w, (float)mquat.x, (float)mquat.y, (float)mquat.z));
rb->set_kinematic(true); rb->set_kinematic(true);
} }
} }
@@ -310,7 +482,7 @@ void initRigidBodyArray(MObject &node)
MEulerRotation meuler(deg2rad(rot[0]), deg2rad(rot[1]), deg2rad(rot[2])); MEulerRotation meuler(deg2rad(rot[0]), deg2rad(rot[1]), deg2rad(rot[2]));
MQuaternion mquat = meuler.asQuaternion(); MQuaternion mquat = meuler.asQuaternion();
rbs[j]->set_transform(pos, quatf(mquat.w, mquat.x, mquat.y, mquat.z)); rbs[j]->set_transform(pos, quatf((float)mquat.w, (float)mquat.x, (float)mquat.y, (float)mquat.z));
rbs[j]->set_linear_velocity(vel); rbs[j]->set_linear_velocity(vel);
rbs[j]->set_angular_velocity(spin); rbs[j]->set_angular_velocity(spin);
rbs[j]->set_kinematic(false); rbs[j]->set_kinematic(false);
@@ -347,7 +519,7 @@ void initRigidBodyArray(MObject &node)
MEulerRotation meuler(deg2rad(rot[0]), deg2rad(rot[1]), deg2rad(rot[2])); MEulerRotation meuler(deg2rad(rot[0]), deg2rad(rot[1]), deg2rad(rot[2]));
MQuaternion mquat = meuler.asQuaternion(); MQuaternion mquat = meuler.asQuaternion();
rbs[j]->set_transform(pos, quatf(mquat.w, mquat.x, mquat.y, mquat.z)); rbs[j]->set_transform(pos, quatf((float)mquat.w, (float)mquat.x, (float)mquat.y, (float)mquat.z));
rbs[j]->set_kinematic(false); rbs[j]->set_kinematic(false);
} }
} }
@@ -400,8 +572,8 @@ void dSolverNode::gatherPassiveTransforms(MPlugArray &rbConnections, std::vector
MVector mpos(fnTransform.getTranslation(MSpace::kTransform)); MVector mpos(fnTransform.getTranslation(MSpace::kTransform));
rb->get_transform(xform.m_x0, xform.m_q0); rb->get_transform(xform.m_x0, xform.m_q0);
xform.m_x1 = vec3f(mpos.x, mpos.y, mpos.z); xform.m_x1 = vec3f((float)mpos.x, (float)mpos.y, (float)mpos.z);
xform.m_q1 = quatf(mquat.w, mquat.x, mquat.y, mquat.z); xform.m_q1 = quatf((float)mquat.w, (float)mquat.x, (float)mquat.y, (float)mquat.z);
xforms.push_back(xform); xforms.push_back(xform);
} }
} else if(fnDagNode.typeId() == rigidBodyArrayNode::typeId) { } else if(fnDagNode.typeId() == rigidBodyArrayNode::typeId) {
@@ -438,7 +610,7 @@ void dSolverNode::gatherPassiveTransforms(MPlugArray &rbConnections, std::vector
MEulerRotation meuler(deg2rad(rot[0]), deg2rad(rot[1]), deg2rad(rot[2])); MEulerRotation meuler(deg2rad(rot[0]), deg2rad(rot[1]), deg2rad(rot[2]));
MQuaternion mquat = meuler.asQuaternion(); MQuaternion mquat = meuler.asQuaternion();
xform.m_q1 = quatf(mquat.w, mquat.x, mquat.y, mquat.z); xform.m_q1 = quatf((float)mquat.w, (float)mquat.x, (float)mquat.y, (float)mquat.z);
xforms.push_back(xform); xforms.push_back(xform);
} }
} }
@@ -468,9 +640,14 @@ void dSolverNode::updatePassiveRigidBodies(MPlugArray &rbConnections, std::vecto
plgMass.getValue(mass); plgMass.getValue(mass);
bool active = (mass>0.f); bool active = (mass>0.f);
if(!active) { if(!active) {
/* Why do we need that?
Static objects are animated in Maya
So just set transform as is
//do linear interpolation for now //do linear interpolation for now
rb->set_transform(xforms[pb].m_x0 + t * (xforms[pb].m_x1 - xforms[pb].m_x0), rb->set_transform(xforms[pb].m_x0 + t * (xforms[pb].m_x1 - xforms[pb].m_x0),
normalize(xforms[pb].m_q0 + t * (xforms[pb].m_q1 - xforms[pb].m_q0))); normalize(xforms[pb].m_q0 + t * (xforms[pb].m_q1 - xforms[pb].m_q0)));
*/
rb->set_transform(xforms[pb].m_x1, xforms[pb].m_q1);
++pb; ++pb;
} }
} else if(fnDagNode.typeId() == rigidBodyArrayNode::typeId) { } else if(fnDagNode.typeId() == rigidBodyArrayNode::typeId) {
@@ -521,6 +698,55 @@ void dSolverNode::updateConstraint(MObject& bodyNode)
vec3f constrPos; vec3f constrPos;
nail->get_world(constrPos); nail->get_world(constrPos);
msgTransform.setTranslation(MVector(constrPos[0], constrPos[1], constrPos[2]), MSpace::kTransform); msgTransform.setTranslation(MVector(constrPos[0], constrPos[1], constrPos[2]), MSpace::kTransform);
msgTransform.setRotation(MEulerRotation(0., 0., 0.));
}
if(msgDagNode.typeId() == hingeConstraintNode::typeId)
{
hingeConstraintNode* hingeNode = static_cast<hingeConstraintNode*>(msgDagNode.userNode());
if(msgDagNode.parentCount() == 0)
{
std::cout << "No transform for hinge constraint found!" << std::endl;
continue;
}
MFnTransform msgTransform(msgDagNode.parent(0));
hinge_constraint_t::pointer hinge = hingeNode->constraint();
vec3f constrPos;
quatf constrRot;
hinge->get_world(constrPos, constrRot);
msgTransform.setTranslation(MVector(constrPos[0], constrPos[1], constrPos[2]), MSpace::kTransform);
msgTransform.setRotation(MQuaternion(constrRot[1], constrRot[2], constrRot[3], constrRot[0]));
}
if(msgDagNode.typeId() == sliderConstraintNode::typeId)
{
sliderConstraintNode* sliderNode = static_cast<sliderConstraintNode*>(msgDagNode.userNode());
if(msgDagNode.parentCount() == 0)
{
std::cout << "No transform for slider constraint found!" << std::endl;
continue;
}
MFnTransform msgTransform(msgDagNode.parent(0));
slider_constraint_t::pointer slider = sliderNode->constraint();
vec3f constrPos;
quatf constrRot;
slider->get_world(constrPos, constrRot);
msgTransform.setTranslation(MVector(constrPos[0], constrPos[1], constrPos[2]), MSpace::kTransform);
msgTransform.setRotation(MQuaternion(constrRot[1], constrRot[2], constrRot[3], constrRot[0]));
}
if(msgDagNode.typeId() == sixdofConstraintNode::typeId)
{
sixdofConstraintNode* sixdofNode = static_cast<sixdofConstraintNode*>(msgDagNode.userNode());
if(msgDagNode.parentCount() == 0)
{
std::cout << "No transform for sixdof constraint found!" << std::endl;
continue;
}
MFnTransform msgTransform(msgDagNode.parent(0));
sixdof_constraint_t::pointer sixdof = sixdofNode->constraint();
vec3f constrPos;
quatf constrRot;
sixdof->get_world(constrPos, constrRot);
msgTransform.setTranslation(MVector(constrPos[0], constrPos[1], constrPos[2]), MSpace::kTransform);
msgTransform.setRotation(MQuaternion(constrRot[1], constrRot[2], constrRot[3], constrRot[0]));
} }
} }
} }
@@ -659,7 +885,7 @@ void dSolverNode::applyFields(MPlugArray &rbConnections, float dt)
MFnField fnField(it.item()); MFnField fnField(it.item());
fnField.getForceAtPoint(position, velocity, mass, force, dt); fnField.getForceAtPoint(position, velocity, mass, force, dt);
for(size_t i = 0; i < rigid_bodies.size(); ++i) { for(size_t i = 0; i < rigid_bodies.size(); ++i) {
rigid_bodies[i]->apply_central_force(vec3f(force[i].x, force[i].y, force[i].z)); rigid_bodies[i]->apply_central_force(vec3f((float)force[i].x, (float)force[i].y, (float)force[i].z));
} }
} }
} }
@@ -689,10 +915,12 @@ void dSolverNode::computeRigidBodies(const MPlug& plug, MDataBlock& data)
if(time == startTime) { if(time == startTime) {
//first frame, init the simulation //first frame, init the simulation
isStartTime = true;
initRigidBodies(rbConnections); initRigidBodies(rbConnections);
solver_t::set_split_impulse(splitImpulseEnabled); solver_t::set_split_impulse(splitImpulseEnabled);
m_prevTime = time; m_prevTime = time;
} else { } else {
isStartTime = false;
double delta_frames = (time - m_prevTime).value(); double delta_frames = (time - m_prevTime).value();
bool playback = MConditionMessage::getConditionState("playingBack"); bool playback = MConditionMessage::getConditionState("playingBack");
if(time > m_prevTime && if(time > m_prevTime &&
@@ -700,7 +928,7 @@ void dSolverNode::computeRigidBodies(const MPlug& plug, MDataBlock& data)
//step the simulation forward, //step the simulation forward,
//don't update if we are jumping more than one frame //don't update if we are jumping more than one frame
float dt = (time - m_prevTime).as(MTime::kSeconds); float dt = (float)(time - m_prevTime).as(MTime::kSeconds);
//gather start and end transform for passive rigid bodies, used for interpolation //gather start and end transform for passive rigid bodies, used for interpolation
std::vector<xforms_t> passiveXForms; std::vector<xforms_t> passiveXForms;
@@ -823,7 +1051,7 @@ void dSolverNode::dumpRigidBodyArray(MObject &node)
std::vector<rigid_body_t::pointer>& rbs = rbaNode->rigid_bodies(); std::vector<rigid_body_t::pointer>& rbs = rbaNode->rigid_bodies();
pdb_io_t pdb_io; pdb_io_t pdb_io;
pdb_io.m_num_particles = rbs.size(); pdb_io.m_num_particles = rbs.size();
pdb_io.m_time = m_prevTime.value(); pdb_io.m_time = (float)m_prevTime.value();
pdb_io.m_attributes.resize(3); pdb_io.m_attributes.resize(3);
//position //position
pdb_io.m_attributes[0].m_num_elements = 1; pdb_io.m_attributes[0].m_num_elements = 1;

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//dSolverNode.h //dSolverNode.h
@@ -68,6 +67,9 @@ public:
public: public:
static MTypeId typeId; static MTypeId typeId;
static MString typeName; static MString typeName;
static bool isStartTime;
static void updateAllRigidBodies();
protected: protected:

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//pluginMain.cpp //pluginMain.cpp
@@ -57,7 +60,7 @@ const char *const colladaDefaultOptions =
MStatus initializePlugin( MObject obj ) MStatus initializePlugin( MObject obj )
{ {
MStatus status; MStatus status;
MFnPlugin plugin( obj, "Walt Disney Feature Animation", "2.75", "Any"); MFnPlugin plugin( obj, "Walt Disney Feature Animation", "2.76", "Any");
solver_t::initialize(); solver_t::initialize();

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//rigidBodyNode.cpp //rigidBodyNode.cpp
@@ -39,6 +42,7 @@ Written by: Nicola Candussi <nicola@fluidinteractive.com>
#include "mayaUtils.h" #include "mayaUtils.h"
#include "solver.h" #include "solver.h"
#include "dSolverNode.h"
MTypeId rigidBodyNode::typeId(0x10032f); MTypeId rigidBodyNode::typeId(0x10032f);
MString rigidBodyNode::typeName("dRigidBody"); MString rigidBodyNode::typeName("dRigidBody");
@@ -174,6 +178,10 @@ MStatus rigidBodyNode::initialize()
status = attributeAffects(ia_angularDamping, ca_rigidBodyParam); status = attributeAffects(ia_angularDamping, ca_rigidBodyParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_angularDamping, ca_rigidBodyParam)") MCHECKSTATUS(status, "adding attributeAffects(ia_angularDamping, ca_rigidBodyParam)")
status = attributeAffects(ia_initialPosition, ca_rigidBodyParam);
MCHECKSTATUS(status, "adding attributeAffects(ia_initialPosition, ca_rigidBodyParam)")
status = attributeAffects(ia_solver, ca_solver); status = attributeAffects(ia_solver, ca_solver);
MCHECKSTATUS(status, "adding attributeAffects(ia_solver, ca_solver)") MCHECKSTATUS(status, "adding attributeAffects(ia_solver, ca_solver)")
@@ -308,7 +316,7 @@ void rigidBodyNode::draw( M3dView & view, const MDagPath &path,
if(style == M3dView::kFlatShaded || if(style == M3dView::kFlatShaded ||
style == M3dView::kGouraudShaded) { style == M3dView::kGouraudShaded) {
glEnable(GL_LIGHTING); glEnable(GL_LIGHTING);
float material[] = { 0.4, 0.7, 1.0, 1.0 }; float material[] = { 0.4f, 0.7f, 1.0f, 1.0f };
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, material); glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, material);
m_rigid_body->collision_shape()->gl_draw(collision_shape_t::kDSSolid); m_rigid_body->collision_shape()->gl_draw(collision_shape_t::kDSSolid);
} }
@@ -383,29 +391,20 @@ void rigidBodyNode::computeRigidBody(const MPlug& plug, MDataBlock& data)
//not connected to a collision shape, put a default one //not connected to a collision shape, put a default one
collision_shape = solver_t::create_sphere_shape(); collision_shape = solver_t::create_sphere_shape();
} }
/* vec3f deltaCenter = prevCenter - collision_shape->center();
quatf deltaRotation = qprod(qconj(collision_shape->rotation()), prevRotation);
MDataHandle hInitPos = data.outputValue(ia_initialPosition);
float3 &ipos = hInitPos.asFloat3();
MDataHandle hInitRot = data.outputValue(ia_initialRotation);
float3 &irot = hInitRot.asFloat3();
MQuaternion iquat = MEulerRotation(deg2rad(irot[0]), deg2rad(irot[1]), deg2rad(irot[2])).asQuaternion();
// MVector deltapos(mtranslation.x - pos[0], mtranslation.y - pos[1], mtranslation.z - pos[2]);
// MQuaternion deltarot = MQuaternion(rot[1], rot[2], rot[3], rot[0]).conjugate() * mrotation;
MVector newipos(ipos[0] + deltaCenter[0], ipos[1] + deltaCenter[1], ipos[2] + deltaCenter[2]); */
// MEulerRotation newirot((iquat * deltarot).asEulerRotation());
//hInitPos.set3Float(newipos.x, newipos.y, newipos.z);
// hInitRot.set3Float(rad2deg(newirot.x), rad2deg(newirot.y), rad2deg(newirot.z));*/
solver_t::remove_rigid_body(m_rigid_body); solver_t::remove_rigid_body(m_rigid_body);
m_rigid_body = solver_t::create_rigid_body(collision_shape); m_rigid_body = solver_t::create_rigid_body(collision_shape);
solver_t::add_rigid_body(m_rigid_body); solver_t::add_rigid_body(m_rigid_body);
// once at creation/load time : get transform from Maya transform node
MFnDagNode fnDagNode(thisObject);
MFnTransform fnTransform(fnDagNode.parent(0));
MVector mtranslation = fnTransform.getTranslation(MSpace::kTransform);
MQuaternion mrotation;
fnTransform.getRotation(mrotation, MSpace::kTransform);
double mscale[3];
fnTransform.getScale(mscale);
m_rigid_body->set_transform(vec3f((float)mtranslation.x, (float)mtranslation.y, (float)mtranslation.z),
quatf((float)mrotation.w, (float)mrotation.x, (float)mrotation.y, (float)mrotation.z));
m_rigid_body->collision_shape()->set_scale(vec3f((float)mscale[0], (float)mscale[1], (float)mscale[2]));
data.outputValue(ca_rigidBody).set(true); data.outputValue(ca_rigidBody).set(true);
data.setClean(plug); data.setClean(plug);
@@ -415,7 +414,6 @@ void rigidBodyNode::computeRigidBody(const MPlug& plug, MDataBlock& data)
void rigidBodyNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data) void rigidBodyNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data)
{ {
// std::cout << "rigidBodyNode::computeWorldMatrix" << std::endl; // std::cout << "rigidBodyNode::computeWorldMatrix" << std::endl;
MObject thisObject(thisMObject()); MObject thisObject(thisMObject());
MFnDagNode fnDagNode(thisObject); MFnDagNode fnDagNode(thisObject);
@@ -430,78 +428,58 @@ void rigidBodyNode::computeWorldMatrix(const MPlug& plug, MDataBlock& data)
MFnTransform fnParentTransform(fnDagNode.parent(0, &status)); MFnTransform fnParentTransform(fnDagNode.parent(0, &status));
MVector mtranslation = fnParentTransform.getTranslation(MSpace::kTransform, &status);
MQuaternion mrotation;
fnParentTransform.getRotation(mrotation, MSpace::kTransform);
double mscale[3]; double mscale[3];
fnParentTransform.getScale(mscale); fnParentTransform.getScale(mscale);
m_rigid_body->get_transform(pos, rot); m_rigid_body->get_transform(pos, rot);
MDataHandle hInitPos = data.outputValue(ia_initialPosition); if(dSolverNode::isStartTime)
float3 &ipos = hInitPos.asFloat3(); { // allow to edit ptranslation and rotation
MVector mtranslation = fnParentTransform.getTranslation(MSpace::kTransform, &status);
MQuaternion mrotation;
fnParentTransform.getRotation(mrotation, MSpace::kTransform);
MDataHandle hInitRot = data.outputValue(ia_initialRotation); float deltaPX = (float)mtranslation.x - pos[0];
float3 &irot = hInitRot.asFloat3(); float deltaPY = (float)mtranslation.y - pos[1];
MQuaternion iquat = MEulerRotation(deg2rad(irot[0]), deg2rad(irot[1]), deg2rad(irot[2])).asQuaternion(); float deltaPZ = (float)mtranslation.z - pos[2];
float deltaRX = (float)mrotation.x - rot[1];
MVector deltapos(mtranslation.x - pos[0], mtranslation.y - pos[1], mtranslation.z - pos[2]); float deltaRY = (float)mrotation.y - rot[2];
MQuaternion deltarot = MQuaternion(rot[1], rot[2], rot[3], rot[0]).conjugate() * mrotation; float deltaRZ = (float)mrotation.z - rot[3];
float deltaRW = (float)mrotation.w - rot[0];
MVector newipos(ipos[0] + deltapos.x, ipos[1] + deltapos.y, ipos[2] + deltapos.z); float deltaSq = deltaPX * deltaPX + deltaPY * deltaPY + deltaPZ * deltaPZ
MEulerRotation newirot((iquat * deltarot).asEulerRotation()); + deltaRX * deltaRX + deltaRY * deltaRY + deltaRZ * deltaRZ + deltaRW * deltaRW;
if(deltaSq > FLT_EPSILON)
float3 &ihpos = hInitPos.asFloat3();
//hInitPos.set3Float(newipos.x, newipos.y, newipos.z);
//for Maya 8.5
ihpos[0] = newipos.x;
ihpos[1] = newipos.y;
ihpos[2] = newipos.z;
float3 &ihrot = hInitRot.asFloat3();
//hInitRot.set3Float(rad2deg(newirot.x), rad2deg(newirot.y), rad2deg(newirot.z));
//for Maya 8.5
ihrot[0] = rad2deg(newirot.x);
ihrot[1] = rad2deg(newirot.y);
ihrot[2] = rad2deg(newirot.z);
m_rigid_body->set_transform(vec3f(mtranslation.x, mtranslation.y, mtranslation.z),
quatf(mrotation.w, mrotation.x, mrotation.y, mrotation.z));
if(pos[0] != float(mtranslation.x) ||
pos[1] != float(mtranslation.y) ||
pos[2] != float(mtranslation.z))
{ {
m_rigid_body->set_transform(vec3f((float)mtranslation.x, (float)mtranslation.y, (float)mtranslation.z),
quatf((float)mrotation.w, (float)mrotation.x, (float)mrotation.y, (float)mrotation.z));
m_rigid_body->set_interpolation_transform(vec3f((float)mtranslation.x, (float)mtranslation.y, (float)mtranslation.z),
quatf((float)mrotation.w, (float)mrotation.x, (float)mrotation.y, (float)mrotation.z));
m_rigid_body->update_constraint(); m_rigid_body->update_constraint();
MDataHandle hInitPos = data.outputValue(ia_initialPosition);
float3 &ihpos = hInitPos.asFloat3();
ihpos[0] = (float)mtranslation.x;
ihpos[1] = (float)mtranslation.y;
ihpos[2] = (float)mtranslation.z;
MDataHandle hInitRot = data.outputValue(ia_initialRotation);
float3 &ihrot = hInitRot.asFloat3();
MEulerRotation newrot(mrotation.asEulerRotation());
ihrot[0] = rad2deg((float)newrot.x);
ihrot[1] = rad2deg((float)newrot.y);
ihrot[2] = rad2deg((float)newrot.z);
}
}
else
{ // if not start time, lock position and rotation for active rigid bodies
float mass = 0.f;
MPlug(thisObject, rigidBodyNode::ia_mass).getValue(mass);
if(mass > 0.f)
{
fnParentTransform.setTranslation(MVector(pos[0], pos[1], pos[2]), MSpace::kTransform);
fnParentTransform.setRotation(MQuaternion(rot[1], rot[2], rot[3], rot[0]));
}
} }
data.setClean(plug); data.setClean(plug);
//set the scale to the collision shape //set the scale to the collision shape
m_rigid_body->collision_shape()->set_scale(vec3f(mscale[0], mscale[1], mscale[2])); m_rigid_body->collision_shape()->set_scale(vec3f((float)mscale[0], (float)mscale[1], (float)mscale[2]));
/*
MPlug plgCollisionShape(thisObject, ia_collisionShape);
//force evaluation of the shape
plgCollisionShape.getValue(update);
if(plgCollisionShape.isConnected()) {
MPlugArray connections;
plgCollisionShape.connectedTo(connections, true, true);
if(connections.length() != 0) {
MFnDependencyNode fnNode(connections[0].node());
if(fnNode.typeId() == collisionShapeNode::typeId) {
MPlug plgScale(fnNode.object(), collisionShapeNode::ia_scale);
plgScale.child(0).setValue(mscale[0]);
plgScale.child(1).setValue(mscale[1]);
plgScale.child(2).setValue(mscale[2]);
} else {
std::cout << "rigidBodyNode connected to a non-collision shape node!" << std::endl;
}
}
}*/
} }
void rigidBodyNode::computeRigidBodyParam(const MPlug& plug, MDataBlock& data) void rigidBodyNode::computeRigidBodyParam(const MPlug& plug, MDataBlock& data)
@@ -513,12 +491,12 @@ void rigidBodyNode::computeRigidBodyParam(const MPlug& plug, MDataBlock& data)
MPlug(thisObject, ca_rigidBody).getValue(update); MPlug(thisObject, ca_rigidBody).getValue(update);
double mass = data.inputValue(ia_mass).asDouble(); double mass = data.inputValue(ia_mass).asDouble();
m_rigid_body->set_mass(mass); m_rigid_body->set_mass((float)mass);
m_rigid_body->set_inertia(mass * m_rigid_body->collision_shape()->local_inertia()); m_rigid_body->set_inertia((float)mass * m_rigid_body->collision_shape()->local_inertia());
m_rigid_body->set_restitution(data.inputValue(ia_restitution).asDouble()); m_rigid_body->set_restitution((float)data.inputValue(ia_restitution).asDouble());
m_rigid_body->set_friction(data.inputValue(ia_friction).asDouble()); m_rigid_body->set_friction((float)data.inputValue(ia_friction).asDouble());
m_rigid_body->set_linear_damping(data.inputValue(ia_linearDamping).asDouble()); m_rigid_body->set_linear_damping((float)data.inputValue(ia_linearDamping).asDouble());
m_rigid_body->set_angular_damping(data.inputValue(ia_angularDamping).asDouble()); m_rigid_body->set_angular_damping((float)data.inputValue(ia_angularDamping).asDouble());
data.outputValue(ca_rigidBodyParam).set(true); data.outputValue(ca_rigidBodyParam).set(true);
data.setClean(plug); data.setClean(plug);
@@ -545,5 +523,4 @@ void rigidBodyNode::update()
MPlug(thisObject, ca_rigidBodyParam).getValue(update); MPlug(thisObject, ca_rigidBodyParam).getValue(update);
MPlug(thisObject, ca_solver).getValue(update); MPlug(thisObject, ca_solver).getValue(update);
MPlug(thisObject, worldMatrix).elementByLogicalIndex(0).getValue(update); MPlug(thisObject, worldMatrix).elementByLogicalIndex(0).getValue(update);
// MPlug plg = MPlug(thisObject, worldMatrix).elementByLogicalIndex(0);
} }

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//rigidBodyNode.h //rigidBodyNode.h
@@ -62,6 +65,7 @@ public:
public: public:
rigid_body_t::pointer rigid_body(); rigid_body_t::pointer rigid_body();
void update();
public: public:
@@ -88,7 +92,6 @@ public:
static MString typeName; static MString typeName;
private: private:
void update();
void computeRigidBody(const MPlug& plug, MDataBlock& data); void computeRigidBody(const MPlug& plug, MDataBlock& data);
void computeWorldMatrix(const MPlug& plug, MDataBlock& data); void computeWorldMatrix(const MPlug& plug, MDataBlock& data);
void computeRigidBodyParam(const MPlug& plug, MDataBlock& data); void computeRigidBodyParam(const MPlug& plug, MDataBlock& data);

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//rigid_body.h //rigid_body.h
@@ -54,6 +57,7 @@ public:
void set_transform(vec3f const& position, quatf const& rotation) { m_impl->set_transform(position, rotation); } void set_transform(vec3f const& position, quatf const& rotation) { m_impl->set_transform(position, rotation); }
void get_transform(vec3f& position, quatf& rotation) const { m_impl->get_transform(position, rotation); } void get_transform(vec3f& position, quatf& rotation) const { m_impl->get_transform(position, rotation); }
void get_transform(mat4x4f& xform) const { m_impl->get_transform(xform); } void get_transform(mat4x4f& xform) const { m_impl->get_transform(xform); }
void set_interpolation_transform(vec3f const& position, quatf const& rotation) { m_impl->set_interpolation_transform(position, rotation); }
// //
void set_linear_velocity(vec3f const& v) { m_impl->set_linear_velocity(v); } void set_linear_velocity(vec3f const& v) { m_impl->set_linear_velocity(v); }

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
@@ -45,6 +48,7 @@ public:
virtual void set_transform(vec3f const& position, quatf const& rotation) = 0; virtual void set_transform(vec3f const& position, quatf const& rotation) = 0;
virtual void get_transform(vec3f& position, quatf& rotation) const = 0; virtual void get_transform(vec3f& position, quatf& rotation) const = 0;
virtual void get_transform(mat4x4f& xform) const = 0; virtual void get_transform(mat4x4f& xform) const = 0;
virtual void set_interpolation_transform(vec3f const& position, quatf const& rotation) = 0;
virtual void set_linear_velocity(vec3f const& v) = 0; virtual void set_linear_velocity(vec3f const& v) = 0;
virtual void get_linear_velocity(vec3f& v) const = 0; virtual void get_linear_velocity(vec3f& v) const = 0;

View File

@@ -0,0 +1,237 @@
//Maya ASCII 8.5 scene
//Name: HingeConstraint.ma
//Last modified: Fri, Jan 22, 2010 06:53:53 PM
//Codeset: 1251
requires maya "8.5";
requires "BulletMayaPlugin" "2.76";
currentUnit -l centimeter -a degree -t film;
fileInfo "application" "maya";
fileInfo "product" "Maya Complete 8.5";
fileInfo "version" "8.5 Service Pack 1";
fileInfo "cutIdentifier" "200706062232-700503";
fileInfo "osv" "Microsoft Windows XP Service Pack 2 (Build 2600)\n";
createNode transform -s -n "persp";
setAttr ".v" no;
setAttr ".t" -type "double3" 2.6026307375884059 9.1186832328358065 43.807258865888613 ;
setAttr ".r" -type "double3" -11.738352729602591 3.4000000000001069 -6.9697312921006584e-016 ;
createNode camera -s -n "perspShape" -p "persp";
setAttr -k off ".v" no;
setAttr ".fl" 34.999999999999993;
setAttr ".coi" 44.82186966202994;
setAttr ".imn" -type "string" "persp";
setAttr ".den" -type "string" "persp_depth";
setAttr ".man" -type "string" "persp_mask";
setAttr ".hc" -type "string" "viewSet -p %camera";
createNode transform -s -n "top";
setAttr ".v" no;
setAttr ".t" -type "double3" 0 100.1 0 ;
setAttr ".r" -type "double3" -89.999999999999986 0 0 ;
createNode camera -s -n "topShape" -p "top";
setAttr -k off ".v" no;
setAttr ".rnd" no;
setAttr ".coi" 100.1;
setAttr ".ow" 30;
setAttr ".imn" -type "string" "top";
setAttr ".den" -type "string" "top_depth";
setAttr ".man" -type "string" "top_mask";
setAttr ".hc" -type "string" "viewSet -t %camera";
setAttr ".o" yes;
createNode transform -s -n "front";
setAttr ".v" no;
setAttr ".t" -type "double3" 0 0 100.1 ;
createNode camera -s -n "frontShape" -p "front";
setAttr -k off ".v" no;
setAttr ".rnd" no;
setAttr ".coi" 100.1;
setAttr ".ow" 30;
setAttr ".imn" -type "string" "front";
setAttr ".den" -type "string" "front_depth";
setAttr ".man" -type "string" "front_mask";
setAttr ".hc" -type "string" "viewSet -f %camera";
setAttr ".o" yes;
createNode transform -s -n "side";
setAttr ".v" no;
setAttr ".t" -type "double3" 100.1 0 0 ;
setAttr ".r" -type "double3" 0 89.999999999999986 0 ;
createNode camera -s -n "sideShape" -p "side";
setAttr -k off ".v" no;
setAttr ".rnd" no;
setAttr ".coi" 100.1;
setAttr ".ow" 30;
setAttr ".imn" -type "string" "side";
setAttr ".den" -type "string" "side_depth";
setAttr ".man" -type "string" "side_mask";
setAttr ".hc" -type "string" "viewSet -s %camera";
setAttr ".o" yes;
createNode transform -n "dRigidBody1";
setAttr ".t" -type "double3" 4 0 0 ;
createNode dRigidBody -n "dRigidBodyShape1" -p "dRigidBody1";
setAttr -k off ".v";
setAttr ".inpo" -type "float3" 4 0 0 ;
createNode transform -n "dRigidBody2";
createNode dRigidBody -n "dRigidBodyShape2" -p "dRigidBody2";
setAttr -k off ".v";
setAttr ".ma" 0;
createNode transform -n "dHingeConstraint1";
createNode dHingeConstraint -n "dHingeConstraintShape1" -p "dHingeConstraint1";
setAttr -k off ".v";
setAttr ".llmt" 0;
setAttr ".ulmt" -1;
setAttr ".pivinB" -type "float3" -4 0 0 ;
createNode lightLinker -n "lightLinker1";
setAttr -s 2 ".lnk";
setAttr -s 2 ".slnk";
createNode displayLayerManager -n "layerManager";
createNode displayLayer -n "defaultLayer";
createNode renderLayerManager -n "renderLayerManager";
createNode renderLayer -n "defaultRenderLayer";
setAttr ".g" yes;
createNode dSolver -n "dSolver1";
setAttr ".grvt" -type "float3" 1.4012985e-045 -9.8100004 0 ;
createNode dCollisionShape -n "dCollisionShape1";
setAttr ".tp" 4;
createNode dCollisionShape -n "dCollisionShape2";
setAttr ".tp" 4;
createNode animCurveTL -n "dRigidBody2_translateX";
setAttr ".tan" 10;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 0 75 -5 150 0 225 5 300 0;
createNode animCurveTL -n "dRigidBody2_translateY";
setAttr ".tan" 10;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 0 75 2.5 150 5 225 2.5 300 0;
createNode animCurveTL -n "dRigidBody2_translateZ";
setAttr ".tan" 10;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 0 75 0 150 0 225 0 300 0;
createNode animCurveTU -n "dRigidBody2_visibility";
setAttr ".tan" 9;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 1 75 1 150 1 225 1 300 1;
setAttr -s 5 ".kot[0:4]" 5 5 5 5 5;
createNode animCurveTA -n "dRigidBody2_rotateX";
setAttr ".tan" 10;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 0 75 0 150 0 225 0 300 0;
createNode animCurveTA -n "dRigidBody2_rotateY";
setAttr ".tan" 10;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 0 75 0 150 0 225 0 300 0;
createNode animCurveTA -n "dRigidBody2_rotateZ";
setAttr ".tan" 10;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 0 75 0 150 0 225 0 300 0;
createNode animCurveTU -n "dRigidBody2_scaleX";
setAttr ".tan" 10;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 1 75 1 150 1 225 1 300 1;
createNode animCurveTU -n "dRigidBody2_scaleY";
setAttr ".tan" 10;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 1 75 1 150 1 225 1 300 1;
createNode animCurveTU -n "dRigidBody2_scaleZ";
setAttr ".tan" 10;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 1 75 1 150 1 225 1 300 1;
createNode script -n "uiConfigurationScriptNode";
setAttr ".b" -type "string" (
"// Maya Mel UI Configuration File.\n//\n// This script is machine generated. Edit at your own risk.\n//\n//\n\nglobal string $gMainPane;\nif (`paneLayout -exists $gMainPane`) {\n\n\tglobal int $gUseScenePanelConfig;\n\tint $useSceneConfig = $gUseScenePanelConfig;\n\tint $menusOkayInPanels = `optionVar -q allowMenusInPanels`;\tint $nVisPanes = `paneLayout -q -nvp $gMainPane`;\n\tint $nPanes = 0;\n\tstring $editorName;\n\tstring $panelName;\n\tstring $itemFilterName;\n\tstring $panelConfig;\n\n\t//\n\t// get current state of the UI\n\t//\n\tsceneUIReplacement -update $gMainPane;\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Top View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Top View\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"top\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n"
+ " -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n"
+ " -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n"
+ " -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Top View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"top\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n"
+ " -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n"
+ " -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Side View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Side View\")) -mbv $menusOkayInPanels `;\n"
+ "\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"side\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n"
+ " -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n"
+ " -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Side View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"side\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n"
+ " -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n"
+ " -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Front View\")) `;\n"
+ "\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Front View\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"front\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n"
+ " -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n"
+ " -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Front View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"front\" \n -useInteractiveMode 0\n -displayLights \"default\" \n"
+ " -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n"
+ " -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n"
+ " -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Persp View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Persp View\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"persp\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n"
+ " -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n"
+ " -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n"
+ "\t\tmodelPanel -edit -l (localizedPanelLabel(\"Persp View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"persp\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n"
+ " -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n"
+ " -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"outlinerPanel\" (localizedPanelLabel(\"Outliner\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `outlinerPanel -unParent -l (localizedPanelLabel(\"Outliner\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n outlinerEditor -e \n -showShapes 0\n -showAttributes 0\n -showConnected 0\n -showAnimCurvesOnly 0\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 1\n -ignoreDagHierarchy 0\n -expandConnections 0\n"
+ " -showUnitlessCurves 1\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 0\n -highlightActive 1\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"defaultSetFilter\" \n -showSetMembers 1\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n"
+ "\t\toutlinerPanel -edit -l (localizedPanelLabel(\"Outliner\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n outlinerEditor -e \n -showShapes 0\n -showAttributes 0\n -showConnected 0\n -showAnimCurvesOnly 0\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 1\n -ignoreDagHierarchy 0\n -expandConnections 0\n -showUnitlessCurves 1\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 0\n -highlightActive 1\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"defaultSetFilter\" \n -showSetMembers 1\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n"
+ " -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"graphEditor\" (localizedPanelLabel(\"Graph Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"graphEditor\" -l (localizedPanelLabel(\"Graph Editor\")) -mbv $menusOkayInPanels `;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 1\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n -showUnitlessCurves 1\n"
+ " -showCompounds 0\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 1\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 1\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"GraphEd\");\n animCurveEditor -e \n -displayKeys 1\n"
+ " -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 1\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -showResults \"off\" \n -showBufferCurves \"off\" \n -smoothness \"fine\" \n -resultSamples 1\n -resultScreenSamples 0\n -resultUpdate \"delayed\" \n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Graph Editor\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 1\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n"
+ " -showUnitlessCurves 1\n -showCompounds 0\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 1\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 1\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"GraphEd\");\n animCurveEditor -e \n"
+ " -displayKeys 1\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 1\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -showResults \"off\" \n -showBufferCurves \"off\" \n -smoothness \"fine\" \n -resultSamples 1\n -resultScreenSamples 0\n -resultUpdate \"delayed\" \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dopeSheetPanel\" (localizedPanelLabel(\"Dope Sheet\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"dopeSheetPanel\" -l (localizedPanelLabel(\"Dope Sheet\")) -mbv $menusOkayInPanels `;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n"
+ " -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n -showUnitlessCurves 0\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 1\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n"
+ " -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"DopeSheetEd\");\n dopeSheetEditor -e \n -displayKeys 1\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -outliner \"dopeSheetPanel1OutlineEd\" \n -showSummary 1\n -showScene 0\n -hierarchyBelow 0\n -showTicks 1\n -selectionWindow 0 0 0 0 \n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Dope Sheet\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n"
+ " -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n -showUnitlessCurves 0\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 1\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n"
+ " -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"DopeSheetEd\");\n dopeSheetEditor -e \n -displayKeys 1\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -outliner \"dopeSheetPanel1OutlineEd\" \n -showSummary 1\n -showScene 0\n -hierarchyBelow 0\n -showTicks 1\n -selectionWindow 0 0 0 0 \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"clipEditorPanel\" (localizedPanelLabel(\"Trax Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"clipEditorPanel\" -l (localizedPanelLabel(\"Trax Editor\")) -mbv $menusOkayInPanels `;\n"
+ "\t\t\t$editorName = clipEditorNameFromPanel($panelName);\n clipEditor -e \n -displayKeys 0\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"none\" \n -snapValue \"none\" \n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Trax Editor\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = clipEditorNameFromPanel($panelName);\n clipEditor -e \n -displayKeys 0\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"none\" \n -snapValue \"none\" \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"hyperGraphPanel\" (localizedPanelLabel(\"Hypergraph Hierarchy\")) `;\n"
+ "\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"hyperGraphPanel\" -l (localizedPanelLabel(\"Hypergraph Hierarchy\")) -mbv $menusOkayInPanels `;\n\n\t\t\t$editorName = ($panelName+\"HyperGraphEd\");\n hyperGraph -e \n -graphLayoutStyle \"hierarchicalLayout\" \n -orientation \"horiz\" \n -zoom 1\n -animateTransition 0\n -showShapes 0\n -showDeformers 0\n -showExpressions 0\n -showConstraints 0\n -showUnderworld 0\n -showInvisible 0\n -transitionFrames 1\n -freeform 0\n -imagePosition 0 0 \n -imageScale 1\n -imageEnabled 0\n -graphType \"DAG\" \n -updateSelection 1\n -updateNodeAdded 1\n -useDrawOverrideColor 0\n -limitGraphTraversal -1\n -iconSize \"smallIcons\" \n -showCachedConnections 0\n"
+ " $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Hypergraph Hierarchy\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"HyperGraphEd\");\n hyperGraph -e \n -graphLayoutStyle \"hierarchicalLayout\" \n -orientation \"horiz\" \n -zoom 1\n -animateTransition 0\n -showShapes 0\n -showDeformers 0\n -showExpressions 0\n -showConstraints 0\n -showUnderworld 0\n -showInvisible 0\n -transitionFrames 1\n -freeform 0\n -imagePosition 0 0 \n -imageScale 1\n -imageEnabled 0\n -graphType \"DAG\" \n -updateSelection 1\n -updateNodeAdded 1\n -useDrawOverrideColor 0\n -limitGraphTraversal -1\n -iconSize \"smallIcons\" \n -showCachedConnections 0\n"
+ " $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"hyperShadePanel\" (localizedPanelLabel(\"Hypershade\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"hyperShadePanel\" -l (localizedPanelLabel(\"Hypershade\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Hypershade\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"visorPanel\" (localizedPanelLabel(\"Visor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"visorPanel\" -l (localizedPanelLabel(\"Visor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Visor\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"polyTexturePlacementPanel\" (localizedPanelLabel(\"UV Texture Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"polyTexturePlacementPanel\" -l (localizedPanelLabel(\"UV Texture Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"UV Texture Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"multiListerPanel\" (localizedPanelLabel(\"Multilister\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"multiListerPanel\" -l (localizedPanelLabel(\"Multilister\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Multilister\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"renderWindowPanel\" (localizedPanelLabel(\"Render View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"renderWindowPanel\" -l (localizedPanelLabel(\"Render View\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Render View\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"blendShapePanel\" (localizedPanelLabel(\"Blend Shape\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\tblendShapePanel -unParent -l (localizedPanelLabel(\"Blend Shape\")) -mbv $menusOkayInPanels ;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tblendShapePanel -edit -l (localizedPanelLabel(\"Blend Shape\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n"
+ "\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dynRelEdPanel\" (localizedPanelLabel(\"Dynamic Relationships\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"dynRelEdPanel\" -l (localizedPanelLabel(\"Dynamic Relationships\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Dynamic Relationships\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"devicePanel\" (localizedPanelLabel(\"Devices\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\tdevicePanel -unParent -l (localizedPanelLabel(\"Devices\")) -mbv $menusOkayInPanels ;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tdevicePanel -edit -l (localizedPanelLabel(\"Devices\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n"
+ "\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"relationshipPanel\" (localizedPanelLabel(\"Relationship Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"relationshipPanel\" -l (localizedPanelLabel(\"Relationship Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Relationship Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"referenceEditorPanel\" (localizedPanelLabel(\"Reference Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"referenceEditorPanel\" -l (localizedPanelLabel(\"Reference Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Reference Editor\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"componentEditorPanel\" (localizedPanelLabel(\"Component Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"componentEditorPanel\" -l (localizedPanelLabel(\"Component Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Component Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dynPaintScriptedPanelType\" (localizedPanelLabel(\"Paint Effects\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"dynPaintScriptedPanelType\" -l (localizedPanelLabel(\"Paint Effects\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Paint Effects\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"webBrowserPanel\" (localizedPanelLabel(\"Web Browser\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"webBrowserPanel\" -l (localizedPanelLabel(\"Web Browser\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Web Browser\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"scriptEditorPanel\" (localizedPanelLabel(\"Script Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"scriptEditorPanel\" -l (localizedPanelLabel(\"Script Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Script Editor\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\tif ($useSceneConfig) {\n string $configName = `getPanel -cwl (localizedPanelLabel(\"Current Layout\"))`;\n if (\"\" != $configName) {\n\t\t\tpanelConfiguration -edit -label (localizedPanelLabel(\"Current Layout\")) \n\t\t\t\t-defaultImage \"\"\n\t\t\t\t-image \"\"\n\t\t\t\t-sc false\n\t\t\t\t-configString \"global string $gMainPane; paneLayout -e -cn \\\"single\\\" -ps 1 100 100 $gMainPane;\"\n\t\t\t\t-removeAllPanels\n\t\t\t\t-ap false\n\t\t\t\t\t(localizedPanelLabel(\"Persp View\")) \n\t\t\t\t\t\"modelPanel\"\n"
+ "\t\t\t\t\t\"$panelName = `modelPanel -unParent -l (localizedPanelLabel(\\\"Persp View\\\")) -mbv $menusOkayInPanels `;\\n$editorName = $panelName;\\nmodelEditor -e \\n -cam `findStartUpCamera persp` \\n -useInteractiveMode 0\\n -displayLights \\\"default\\\" \\n -displayAppearance \\\"wireframe\\\" \\n -activeOnly 0\\n -wireframeOnShaded 0\\n -headsUpDisplay 1\\n -selectionHiliteDisplay 1\\n -useDefaultMaterial 0\\n -bufferMode \\\"double\\\" \\n -twoSidedLighting 1\\n -backfaceCulling 0\\n -xray 0\\n -displayTextures 0\\n -smoothWireframe 0\\n -textureAnisotropic 0\\n -textureHilight 1\\n -textureSampling 2\\n -textureDisplay \\\"modulate\\\" \\n -textureMaxSize 8192\\n -fogging 0\\n -fogSource \\\"fragment\\\" \\n -fogMode \\\"linear\\\" \\n -fogStart 0\\n -fogEnd 100\\n -fogDensity 0.1\\n -fogColor 0.5 0.5 0.5 1 \\n -maxConstantTransparency 1\\n -rendererName \\\"base_OpenGL_Renderer\\\" \\n -colorResolution 256 256 \\n -bumpResolution 512 512 \\n -textureCompression 0\\n -transparencyAlgorithm \\\"frontAndBackCull\\\" \\n -transpInShadows 0\\n -cullingOverride \\\"none\\\" \\n -lowQualityLighting 0\\n -maximumNumHardwareLights 1\\n -occlusionCulling 0\\n -useBaseRenderer 0\\n -useReducedRenderer 0\\n -smallObjectCulling 0\\n -smallObjectThreshold -1 \\n -interactiveDisableShadows 0\\n -interactiveBackFaceCull 0\\n -sortTransparent 1\\n -nurbsCurves 1\\n -nurbsSurfaces 1\\n -polymeshes 1\\n -subdivSurfaces 1\\n -planes 1\\n -lights 1\\n -cameras 1\\n -controlVertices 1\\n -hulls 1\\n -grid 1\\n -joints 1\\n -ikHandles 1\\n -deformers 1\\n -dynamics 1\\n -fluids 1\\n -hairSystems 1\\n -follicles 1\\n -nCloths 1\\n -nRigids 1\\n -dynamicConstraints 1\\n -locators 1\\n -manipulators 1\\n -dimensions 1\\n -handles 1\\n -pivots 1\\n -textures 1\\n -strokes 1\\n -shadows 0\\n $editorName;\\nmodelEditor -e -viewSelected 0 $editorName\"\n"
+ "\t\t\t\t\t\"modelPanel -edit -l (localizedPanelLabel(\\\"Persp View\\\")) -mbv $menusOkayInPanels $panelName;\\n$editorName = $panelName;\\nmodelEditor -e \\n -cam `findStartUpCamera persp` \\n -useInteractiveMode 0\\n -displayLights \\\"default\\\" \\n -displayAppearance \\\"wireframe\\\" \\n -activeOnly 0\\n -wireframeOnShaded 0\\n -headsUpDisplay 1\\n -selectionHiliteDisplay 1\\n -useDefaultMaterial 0\\n -bufferMode \\\"double\\\" \\n -twoSidedLighting 1\\n -backfaceCulling 0\\n -xray 0\\n -displayTextures 0\\n -smoothWireframe 0\\n -textureAnisotropic 0\\n -textureHilight 1\\n -textureSampling 2\\n -textureDisplay \\\"modulate\\\" \\n -textureMaxSize 8192\\n -fogging 0\\n -fogSource \\\"fragment\\\" \\n -fogMode \\\"linear\\\" \\n -fogStart 0\\n -fogEnd 100\\n -fogDensity 0.1\\n -fogColor 0.5 0.5 0.5 1 \\n -maxConstantTransparency 1\\n -rendererName \\\"base_OpenGL_Renderer\\\" \\n -colorResolution 256 256 \\n -bumpResolution 512 512 \\n -textureCompression 0\\n -transparencyAlgorithm \\\"frontAndBackCull\\\" \\n -transpInShadows 0\\n -cullingOverride \\\"none\\\" \\n -lowQualityLighting 0\\n -maximumNumHardwareLights 1\\n -occlusionCulling 0\\n -useBaseRenderer 0\\n -useReducedRenderer 0\\n -smallObjectCulling 0\\n -smallObjectThreshold -1 \\n -interactiveDisableShadows 0\\n -interactiveBackFaceCull 0\\n -sortTransparent 1\\n -nurbsCurves 1\\n -nurbsSurfaces 1\\n -polymeshes 1\\n -subdivSurfaces 1\\n -planes 1\\n -lights 1\\n -cameras 1\\n -controlVertices 1\\n -hulls 1\\n -grid 1\\n -joints 1\\n -ikHandles 1\\n -deformers 1\\n -dynamics 1\\n -fluids 1\\n -hairSystems 1\\n -follicles 1\\n -nCloths 1\\n -nRigids 1\\n -dynamicConstraints 1\\n -locators 1\\n -manipulators 1\\n -dimensions 1\\n -handles 1\\n -pivots 1\\n -textures 1\\n -strokes 1\\n -shadows 0\\n $editorName;\\nmodelEditor -e -viewSelected 0 $editorName\"\n"
+ "\t\t\t\t$configName;\n\n setNamedPanelLayout (localizedPanelLabel(\"Current Layout\"));\n }\n\n panelHistory -e -clear mainPanelHistory;\n setFocus `paneLayout -q -p1 $gMainPane`;\n sceneUIReplacement -deleteRemaining;\n sceneUIReplacement -clear;\n\t}\n\n\ngrid -spacing 5 -size 12 -divisions 5 -displayAxes yes -displayGridLines yes -displayDivisionLines yes -displayPerspectiveLabels no -displayOrthographicLabels no -displayAxesBold yes -perspectiveLabelPosition axis -orthographicLabelPosition edge;\n}\n");
setAttr ".st" 3;
createNode script -n "sceneConfigurationScriptNode";
setAttr ".b" -type "string" "playbackOptions -min 1 -max 300 -ast 1 -aet 300 ";
setAttr ".st" 6;
select -ne :time1;
setAttr ".o" 1;
select -ne :renderPartition;
setAttr -s 2 ".st";
select -ne :renderGlobalsList1;
select -ne :defaultShaderList1;
setAttr -s 2 ".s";
select -ne :postProcessList1;
setAttr -s 2 ".p";
select -ne :lightList1;
select -ne :initialShadingGroup;
setAttr ".ro" yes;
select -ne :initialParticleSE;
setAttr ".ro" yes;
select -ne :hardwareRenderGlobals;
setAttr ".ctrs" 256;
setAttr ".btrs" 512;
select -ne :defaultHardwareRenderGlobals;
setAttr ".fn" -type "string" "im";
setAttr ".res" -type "string" "ntsc_4d 646 485 1.333";
connectAttr "dSolver1.rbds" "dRigidBodyShape1.solv";
connectAttr "dCollisionShape1.oucs" "dRigidBodyShape1.incs";
connectAttr "dRigidBody2_translateX.o" "dRigidBody2.tx";
connectAttr "dRigidBody2_translateY.o" "dRigidBody2.ty";
connectAttr "dRigidBody2_translateZ.o" "dRigidBody2.tz";
connectAttr "dRigidBody2_visibility.o" "dRigidBody2.v";
connectAttr "dRigidBody2_rotateX.o" "dRigidBody2.rx";
connectAttr "dRigidBody2_rotateY.o" "dRigidBody2.ry";
connectAttr "dRigidBody2_rotateZ.o" "dRigidBody2.rz";
connectAttr "dRigidBody2_scaleX.o" "dRigidBody2.sx";
connectAttr "dRigidBody2_scaleY.o" "dRigidBody2.sy";
connectAttr "dRigidBody2_scaleZ.o" "dRigidBody2.sz";
connectAttr "dSolver1.rbds" "dRigidBodyShape2.solv";
connectAttr "dCollisionShape2.oucs" "dRigidBodyShape2.incs";
connectAttr "dRigidBodyShape2.msg" "dHingeConstraintShape1.inrba";
connectAttr "dRigidBodyShape1.msg" "dHingeConstraintShape1.inrbb";
connectAttr ":defaultLightSet.msg" "lightLinker1.lnk[0].llnk";
connectAttr ":initialShadingGroup.msg" "lightLinker1.lnk[0].olnk";
connectAttr ":defaultLightSet.msg" "lightLinker1.lnk[1].llnk";
connectAttr ":initialParticleSE.msg" "lightLinker1.lnk[1].olnk";
connectAttr ":defaultLightSet.msg" "lightLinker1.slnk[0].sllk";
connectAttr ":initialShadingGroup.msg" "lightLinker1.slnk[0].solk";
connectAttr ":defaultLightSet.msg" "lightLinker1.slnk[1].sllk";
connectAttr ":initialParticleSE.msg" "lightLinker1.slnk[1].solk";
connectAttr "layerManager.dli[0]" "defaultLayer.id";
connectAttr "renderLayerManager.rlmi[0]" "defaultRenderLayer.rlid";
connectAttr ":time1.o" "dSolver1.it";
connectAttr "lightLinker1.msg" ":lightList1.ln" -na;
// End of HingeConstraint.ma

View File

@@ -0,0 +1,272 @@
//Maya ASCII 8.5 scene
//Name: NailConstraint.ma
//Last modified: Fri, Jan 22, 2010 06:52:24 PM
//Codeset: 1251
requires maya "8.5";
requires "BulletMayaPlugin" "2.76";
currentUnit -l centimeter -a degree -t film;
fileInfo "application" "maya";
fileInfo "product" "Maya Complete 8.5";
fileInfo "version" "8.5 Service Pack 1";
fileInfo "cutIdentifier" "200706062232-700503";
fileInfo "osv" "Microsoft Windows XP Service Pack 2 (Build 2600)\n";
createNode transform -s -n "persp";
setAttr ".v" no;
setAttr ".t" -type "double3" 11.930209659210078 13.423021047895404 -23.824078177088047 ;
setAttr ".r" -type "double3" -26.738352729592183 -206.59999999999334 0 ;
createNode camera -s -n "perspShape" -p "persp";
setAttr -k off ".v" no;
setAttr ".fl" 34.999999999999993;
setAttr ".coi" 29.834444817247473;
setAttr ".imn" -type "string" "persp";
setAttr ".den" -type "string" "persp_depth";
setAttr ".man" -type "string" "persp_mask";
setAttr ".hc" -type "string" "viewSet -p %camera";
createNode transform -s -n "top";
setAttr ".v" no;
setAttr ".t" -type "double3" 0 100.1 0 ;
setAttr ".r" -type "double3" -89.999999999999986 0 0 ;
createNode camera -s -n "topShape" -p "top";
setAttr -k off ".v" no;
setAttr ".rnd" no;
setAttr ".coi" 100.1;
setAttr ".ow" 30;
setAttr ".imn" -type "string" "top";
setAttr ".den" -type "string" "top_depth";
setAttr ".man" -type "string" "top_mask";
setAttr ".hc" -type "string" "viewSet -t %camera";
setAttr ".o" yes;
createNode transform -s -n "front";
setAttr ".v" no;
setAttr ".t" -type "double3" 0 0 100.1 ;
createNode camera -s -n "frontShape" -p "front";
setAttr -k off ".v" no;
setAttr ".rnd" no;
setAttr ".coi" 100.1;
setAttr ".ow" 30;
setAttr ".imn" -type "string" "front";
setAttr ".den" -type "string" "front_depth";
setAttr ".man" -type "string" "front_mask";
setAttr ".hc" -type "string" "viewSet -f %camera";
setAttr ".o" yes;
createNode transform -s -n "side";
setAttr ".v" no;
setAttr ".t" -type "double3" 100.1 0 0 ;
setAttr ".r" -type "double3" 0 89.999999999999986 0 ;
createNode camera -s -n "sideShape" -p "side";
setAttr -k off ".v" no;
setAttr ".rnd" no;
setAttr ".coi" 100.1;
setAttr ".ow" 30;
setAttr ".imn" -type "string" "side";
setAttr ".den" -type "string" "side_depth";
setAttr ".man" -type "string" "side_mask";
setAttr ".hc" -type "string" "viewSet -s %camera";
setAttr ".o" yes;
createNode transform -n "dRigidBody1";
createNode dRigidBody -n "dRigidBodyShape1" -p "dRigidBody1";
setAttr -k off ".v";
setAttr ".ma" 0;
createNode transform -n "dRigidBody2";
setAttr ".t" -type "double3" 5 0 0 ;
createNode dRigidBody -n "dRigidBodyShape2" -p "dRigidBody2";
setAttr -k off ".v";
setAttr ".inpo" -type "float3" 5 0 0 ;
createNode transform -n "dNailConstraint1";
createNode dNailConstraint -n "dNailConstraintShape1" -p "dNailConstraint1";
setAttr -k off ".v";
setAttr ".pivb" -type "float3" -5 0 0 ;
createNode lightLinker -n "lightLinker1";
setAttr -s 2 ".lnk";
setAttr -s 2 ".slnk";
createNode displayLayerManager -n "layerManager";
createNode displayLayer -n "defaultLayer";
createNode renderLayerManager -n "renderLayerManager";
createNode renderLayer -n "defaultRenderLayer";
setAttr ".g" yes;
createNode dSolver -n "dSolver1";
setAttr ".grvt" -type "float3" 1.4012985e-045 -9.8100004 0 ;
createNode script -n "uiConfigurationScriptNode";
setAttr ".b" -type "string" (
"// Maya Mel UI Configuration File.\n//\n// This script is machine generated. Edit at your own risk.\n//\n//\n\nglobal string $gMainPane;\nif (`paneLayout -exists $gMainPane`) {\n\n\tglobal int $gUseScenePanelConfig;\n\tint $useSceneConfig = $gUseScenePanelConfig;\n\tint $menusOkayInPanels = `optionVar -q allowMenusInPanels`;\tint $nVisPanes = `paneLayout -q -nvp $gMainPane`;\n\tint $nPanes = 0;\n\tstring $editorName;\n\tstring $panelName;\n\tstring $itemFilterName;\n\tstring $panelConfig;\n\n\t//\n\t// get current state of the UI\n\t//\n\tsceneUIReplacement -update $gMainPane;\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Top View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Top View\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"top\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n"
+ " -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n"
+ " -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n"
+ " -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Top View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"top\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n"
+ " -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n"
+ " -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Side View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Side View\")) -mbv $menusOkayInPanels `;\n"
+ "\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"side\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n"
+ " -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n"
+ " -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Side View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"side\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n"
+ " -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n"
+ " -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Front View\")) `;\n"
+ "\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Front View\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"front\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n"
+ " -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n"
+ " -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Front View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"front\" \n -useInteractiveMode 0\n -displayLights \"default\" \n"
+ " -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n"
+ " -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n"
+ " -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Persp View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Persp View\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"persp\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n"
+ " -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n"
+ " -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n"
+ "\t\tmodelPanel -edit -l (localizedPanelLabel(\"Persp View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"persp\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n"
+ " -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n"
+ " -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"outlinerPanel\" (localizedPanelLabel(\"Outliner\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `outlinerPanel -unParent -l (localizedPanelLabel(\"Outliner\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n outlinerEditor -e \n -showShapes 0\n -showAttributes 0\n -showConnected 0\n -showAnimCurvesOnly 0\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 1\n -ignoreDagHierarchy 0\n -expandConnections 0\n"
+ " -showUnitlessCurves 1\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 0\n -highlightActive 1\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"defaultSetFilter\" \n -showSetMembers 1\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n"
+ "\t\toutlinerPanel -edit -l (localizedPanelLabel(\"Outliner\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n outlinerEditor -e \n -showShapes 0\n -showAttributes 0\n -showConnected 0\n -showAnimCurvesOnly 0\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 1\n -ignoreDagHierarchy 0\n -expandConnections 0\n -showUnitlessCurves 1\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 0\n -highlightActive 1\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"defaultSetFilter\" \n -showSetMembers 1\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n"
+ " -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"graphEditor\" (localizedPanelLabel(\"Graph Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"graphEditor\" -l (localizedPanelLabel(\"Graph Editor\")) -mbv $menusOkayInPanels `;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 1\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n -showUnitlessCurves 1\n"
+ " -showCompounds 0\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 1\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 1\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"GraphEd\");\n animCurveEditor -e \n -displayKeys 1\n"
+ " -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 1\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -showResults \"off\" \n -showBufferCurves \"off\" \n -smoothness \"fine\" \n -resultSamples 1\n -resultScreenSamples 0\n -resultUpdate \"delayed\" \n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Graph Editor\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 1\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n"
+ " -showUnitlessCurves 1\n -showCompounds 0\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 1\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 1\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"GraphEd\");\n animCurveEditor -e \n"
+ " -displayKeys 1\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 1\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -showResults \"off\" \n -showBufferCurves \"off\" \n -smoothness \"fine\" \n -resultSamples 1\n -resultScreenSamples 0\n -resultUpdate \"delayed\" \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dopeSheetPanel\" (localizedPanelLabel(\"Dope Sheet\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"dopeSheetPanel\" -l (localizedPanelLabel(\"Dope Sheet\")) -mbv $menusOkayInPanels `;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n"
+ " -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n -showUnitlessCurves 0\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 1\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n"
+ " -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"DopeSheetEd\");\n dopeSheetEditor -e \n -displayKeys 1\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -outliner \"dopeSheetPanel1OutlineEd\" \n -showSummary 1\n -showScene 0\n -hierarchyBelow 0\n -showTicks 1\n -selectionWindow 0 0 0 0 \n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Dope Sheet\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n"
+ " -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n -showUnitlessCurves 0\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 1\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n"
+ " -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"DopeSheetEd\");\n dopeSheetEditor -e \n -displayKeys 1\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -outliner \"dopeSheetPanel1OutlineEd\" \n -showSummary 1\n -showScene 0\n -hierarchyBelow 0\n -showTicks 1\n -selectionWindow 0 0 0 0 \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"clipEditorPanel\" (localizedPanelLabel(\"Trax Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"clipEditorPanel\" -l (localizedPanelLabel(\"Trax Editor\")) -mbv $menusOkayInPanels `;\n"
+ "\t\t\t$editorName = clipEditorNameFromPanel($panelName);\n clipEditor -e \n -displayKeys 0\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"none\" \n -snapValue \"none\" \n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Trax Editor\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = clipEditorNameFromPanel($panelName);\n clipEditor -e \n -displayKeys 0\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"none\" \n -snapValue \"none\" \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"hyperGraphPanel\" (localizedPanelLabel(\"Hypergraph Hierarchy\")) `;\n"
+ "\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"hyperGraphPanel\" -l (localizedPanelLabel(\"Hypergraph Hierarchy\")) -mbv $menusOkayInPanels `;\n\n\t\t\t$editorName = ($panelName+\"HyperGraphEd\");\n hyperGraph -e \n -graphLayoutStyle \"hierarchicalLayout\" \n -orientation \"horiz\" \n -zoom 1\n -animateTransition 0\n -showShapes 0\n -showDeformers 0\n -showExpressions 0\n -showConstraints 0\n -showUnderworld 0\n -showInvisible 0\n -transitionFrames 1\n -freeform 0\n -imagePosition 0 0 \n -imageScale 1\n -imageEnabled 0\n -graphType \"DAG\" \n -updateSelection 1\n -updateNodeAdded 1\n -useDrawOverrideColor 0\n -limitGraphTraversal -1\n -iconSize \"smallIcons\" \n -showCachedConnections 0\n"
+ " $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Hypergraph Hierarchy\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"HyperGraphEd\");\n hyperGraph -e \n -graphLayoutStyle \"hierarchicalLayout\" \n -orientation \"horiz\" \n -zoom 1\n -animateTransition 0\n -showShapes 0\n -showDeformers 0\n -showExpressions 0\n -showConstraints 0\n -showUnderworld 0\n -showInvisible 0\n -transitionFrames 1\n -freeform 0\n -imagePosition 0 0 \n -imageScale 1\n -imageEnabled 0\n -graphType \"DAG\" \n -updateSelection 1\n -updateNodeAdded 1\n -useDrawOverrideColor 0\n -limitGraphTraversal -1\n -iconSize \"smallIcons\" \n -showCachedConnections 0\n"
+ " $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"hyperShadePanel\" (localizedPanelLabel(\"Hypershade\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"hyperShadePanel\" -l (localizedPanelLabel(\"Hypershade\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Hypershade\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"visorPanel\" (localizedPanelLabel(\"Visor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"visorPanel\" -l (localizedPanelLabel(\"Visor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Visor\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"polyTexturePlacementPanel\" (localizedPanelLabel(\"UV Texture Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"polyTexturePlacementPanel\" -l (localizedPanelLabel(\"UV Texture Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"UV Texture Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"multiListerPanel\" (localizedPanelLabel(\"Multilister\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"multiListerPanel\" -l (localizedPanelLabel(\"Multilister\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Multilister\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"renderWindowPanel\" (localizedPanelLabel(\"Render View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"renderWindowPanel\" -l (localizedPanelLabel(\"Render View\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Render View\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"blendShapePanel\" (localizedPanelLabel(\"Blend Shape\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\tblendShapePanel -unParent -l (localizedPanelLabel(\"Blend Shape\")) -mbv $menusOkayInPanels ;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tblendShapePanel -edit -l (localizedPanelLabel(\"Blend Shape\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n"
+ "\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dynRelEdPanel\" (localizedPanelLabel(\"Dynamic Relationships\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"dynRelEdPanel\" -l (localizedPanelLabel(\"Dynamic Relationships\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Dynamic Relationships\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"devicePanel\" (localizedPanelLabel(\"Devices\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\tdevicePanel -unParent -l (localizedPanelLabel(\"Devices\")) -mbv $menusOkayInPanels ;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tdevicePanel -edit -l (localizedPanelLabel(\"Devices\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n"
+ "\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"relationshipPanel\" (localizedPanelLabel(\"Relationship Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"relationshipPanel\" -l (localizedPanelLabel(\"Relationship Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Relationship Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"referenceEditorPanel\" (localizedPanelLabel(\"Reference Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"referenceEditorPanel\" -l (localizedPanelLabel(\"Reference Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Reference Editor\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"componentEditorPanel\" (localizedPanelLabel(\"Component Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"componentEditorPanel\" -l (localizedPanelLabel(\"Component Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Component Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dynPaintScriptedPanelType\" (localizedPanelLabel(\"Paint Effects\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"dynPaintScriptedPanelType\" -l (localizedPanelLabel(\"Paint Effects\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Paint Effects\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"webBrowserPanel\" (localizedPanelLabel(\"Web Browser\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"webBrowserPanel\" -l (localizedPanelLabel(\"Web Browser\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Web Browser\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"scriptEditorPanel\" (localizedPanelLabel(\"Script Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"scriptEditorPanel\" -l (localizedPanelLabel(\"Script Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Script Editor\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"hyperGraphPanel\" (localizedPanelLabel(\"Hypergraph\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"hyperGraphPanel\" -l (localizedPanelLabel(\"Hypergraph\")) -mbv $menusOkayInPanels `;\n\n\t\t\t$editorName = ($panelName+\"HyperGraphEd\");\n hyperGraph -e \n -graphLayoutStyle \"hierarchicalLayout\" \n -orientation \"horiz\" \n -zoom 1\n -animateTransition 0\n -showShapes 0\n -showDeformers 0\n -showExpressions 0\n -showConstraints 0\n -showUnderworld 0\n -showInvisible 0\n -transitionFrames 1\n -freeform 0\n -imagePosition 0 0 \n -imageScale 1\n -imageEnabled 0\n -graphType \"DAG\" \n -updateSelection 1\n -updateNodeAdded 1\n"
+ " -useDrawOverrideColor 0\n -limitGraphTraversal -1\n -iconSize \"smallIcons\" \n -showCachedConnections 0\n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Hypergraph\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"HyperGraphEd\");\n hyperGraph -e \n -graphLayoutStyle \"hierarchicalLayout\" \n -orientation \"horiz\" \n -zoom 1\n -animateTransition 0\n -showShapes 0\n -showDeformers 0\n -showExpressions 0\n -showConstraints 0\n -showUnderworld 0\n -showInvisible 0\n -transitionFrames 1\n -freeform 0\n -imagePosition 0 0 \n -imageScale 1\n -imageEnabled 0\n -graphType \"DAG\" \n -updateSelection 1\n -updateNodeAdded 1\n"
+ " -useDrawOverrideColor 0\n -limitGraphTraversal -1\n -iconSize \"smallIcons\" \n -showCachedConnections 0\n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\tif ($useSceneConfig) {\n string $configName = `getPanel -cwl (localizedPanelLabel(\"Current Layout\"))`;\n if (\"\" != $configName) {\n\t\t\tpanelConfiguration -edit -label (localizedPanelLabel(\"Current Layout\")) \n\t\t\t\t-defaultImage \"\"\n\t\t\t\t-image \"\"\n\t\t\t\t-sc false\n\t\t\t\t-configString \"global string $gMainPane; paneLayout -e -cn \\\"single\\\" -ps 1 100 100 $gMainPane;\"\n\t\t\t\t-removeAllPanels\n\t\t\t\t-ap false\n\t\t\t\t\t(localizedPanelLabel(\"Persp View\")) \n\t\t\t\t\t\"modelPanel\"\n"
+ "\t\t\t\t\t\"$panelName = `modelPanel -unParent -l (localizedPanelLabel(\\\"Persp View\\\")) -mbv $menusOkayInPanels `;\\n$editorName = $panelName;\\nmodelEditor -e \\n -cam `findStartUpCamera persp` \\n -useInteractiveMode 0\\n -displayLights \\\"default\\\" \\n -displayAppearance \\\"wireframe\\\" \\n -activeOnly 0\\n -wireframeOnShaded 0\\n -headsUpDisplay 1\\n -selectionHiliteDisplay 1\\n -useDefaultMaterial 0\\n -bufferMode \\\"double\\\" \\n -twoSidedLighting 1\\n -backfaceCulling 0\\n -xray 0\\n -displayTextures 0\\n -smoothWireframe 0\\n -textureAnisotropic 0\\n -textureHilight 1\\n -textureSampling 2\\n -textureDisplay \\\"modulate\\\" \\n -textureMaxSize 8192\\n -fogging 0\\n -fogSource \\\"fragment\\\" \\n -fogMode \\\"linear\\\" \\n -fogStart 0\\n -fogEnd 100\\n -fogDensity 0.1\\n -fogColor 0.5 0.5 0.5 1 \\n -maxConstantTransparency 1\\n -rendererName \\\"base_OpenGL_Renderer\\\" \\n -colorResolution 256 256 \\n -bumpResolution 512 512 \\n -textureCompression 0\\n -transparencyAlgorithm \\\"frontAndBackCull\\\" \\n -transpInShadows 0\\n -cullingOverride \\\"none\\\" \\n -lowQualityLighting 0\\n -maximumNumHardwareLights 1\\n -occlusionCulling 0\\n -useBaseRenderer 0\\n -useReducedRenderer 0\\n -smallObjectCulling 0\\n -smallObjectThreshold -1 \\n -interactiveDisableShadows 0\\n -interactiveBackFaceCull 0\\n -sortTransparent 1\\n -nurbsCurves 1\\n -nurbsSurfaces 1\\n -polymeshes 1\\n -subdivSurfaces 1\\n -planes 1\\n -lights 1\\n -cameras 1\\n -controlVertices 1\\n -hulls 1\\n -grid 1\\n -joints 1\\n -ikHandles 1\\n -deformers 1\\n -dynamics 1\\n -fluids 1\\n -hairSystems 1\\n -follicles 1\\n -nCloths 1\\n -nRigids 1\\n -dynamicConstraints 1\\n -locators 1\\n -manipulators 1\\n -dimensions 1\\n -handles 1\\n -pivots 1\\n -textures 1\\n -strokes 1\\n -shadows 0\\n $editorName;\\nmodelEditor -e -viewSelected 0 $editorName\"\n"
+ "\t\t\t\t\t\"modelPanel -edit -l (localizedPanelLabel(\\\"Persp View\\\")) -mbv $menusOkayInPanels $panelName;\\n$editorName = $panelName;\\nmodelEditor -e \\n -cam `findStartUpCamera persp` \\n -useInteractiveMode 0\\n -displayLights \\\"default\\\" \\n -displayAppearance \\\"wireframe\\\" \\n -activeOnly 0\\n -wireframeOnShaded 0\\n -headsUpDisplay 1\\n -selectionHiliteDisplay 1\\n -useDefaultMaterial 0\\n -bufferMode \\\"double\\\" \\n -twoSidedLighting 1\\n -backfaceCulling 0\\n -xray 0\\n -displayTextures 0\\n -smoothWireframe 0\\n -textureAnisotropic 0\\n -textureHilight 1\\n -textureSampling 2\\n -textureDisplay \\\"modulate\\\" \\n -textureMaxSize 8192\\n -fogging 0\\n -fogSource \\\"fragment\\\" \\n -fogMode \\\"linear\\\" \\n -fogStart 0\\n -fogEnd 100\\n -fogDensity 0.1\\n -fogColor 0.5 0.5 0.5 1 \\n -maxConstantTransparency 1\\n -rendererName \\\"base_OpenGL_Renderer\\\" \\n -colorResolution 256 256 \\n -bumpResolution 512 512 \\n -textureCompression 0\\n -transparencyAlgorithm \\\"frontAndBackCull\\\" \\n -transpInShadows 0\\n -cullingOverride \\\"none\\\" \\n -lowQualityLighting 0\\n -maximumNumHardwareLights 1\\n -occlusionCulling 0\\n -useBaseRenderer 0\\n -useReducedRenderer 0\\n -smallObjectCulling 0\\n -smallObjectThreshold -1 \\n -interactiveDisableShadows 0\\n -interactiveBackFaceCull 0\\n -sortTransparent 1\\n -nurbsCurves 1\\n -nurbsSurfaces 1\\n -polymeshes 1\\n -subdivSurfaces 1\\n -planes 1\\n -lights 1\\n -cameras 1\\n -controlVertices 1\\n -hulls 1\\n -grid 1\\n -joints 1\\n -ikHandles 1\\n -deformers 1\\n -dynamics 1\\n -fluids 1\\n -hairSystems 1\\n -follicles 1\\n -nCloths 1\\n -nRigids 1\\n -dynamicConstraints 1\\n -locators 1\\n -manipulators 1\\n -dimensions 1\\n -handles 1\\n -pivots 1\\n -textures 1\\n -strokes 1\\n -shadows 0\\n $editorName;\\nmodelEditor -e -viewSelected 0 $editorName\"\n"
+ "\t\t\t\t$configName;\n\n setNamedPanelLayout (localizedPanelLabel(\"Current Layout\"));\n }\n\n panelHistory -e -clear mainPanelHistory;\n setFocus `paneLayout -q -p1 $gMainPane`;\n sceneUIReplacement -deleteRemaining;\n sceneUIReplacement -clear;\n\t}\n\n\ngrid -spacing 5 -size 12 -divisions 5 -displayAxes yes -displayGridLines yes -displayDivisionLines yes -displayPerspectiveLabels no -displayOrthographicLabels no -displayAxesBold yes -perspectiveLabelPosition axis -orthographicLabelPosition edge;\n}\n");
setAttr ".st" 3;
createNode script -n "sceneConfigurationScriptNode";
setAttr ".b" -type "string" "playbackOptions -min 1 -max 300 -ast 1 -aet 300 ";
setAttr ".st" 6;
createNode dCollisionShape -n "dCollisionShape1";
setAttr ".tp" 4;
createNode animCurveTU -n "dRigidBody1_visibility";
setAttr ".tan" 9;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 1 75 1 150 1 225 1 300 1;
setAttr -s 5 ".kot[1:4]" 5 9 5 9;
createNode animCurveTL -n "dRigidBody1_translateX";
setAttr ".tan" 10;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 0 75 4 150 0 225 -4 300 0;
setAttr -s 5 ".kit[0:4]" 1 10 9 10 1;
setAttr -s 5 ".kot[0:4]" 1 10 9 10 1;
setAttr -s 5 ".kix[0:4]" 0.99868637323379517 1 0.61564409732818604
1 0.99992853403091431;
setAttr -s 5 ".kiy[0:4]" 0.051240812987089157 0 -0.7880244255065918
0 0.01195460744202137;
setAttr -s 5 ".kox[0:4]" 0.99868637323379517 1 0.61564409732818604
1 0.99992853403091431;
setAttr -s 5 ".koy[0:4]" 0.051240716129541397 0 -0.7880244255065918
0 0.011954654939472675;
createNode animCurveTL -n "dRigidBody1_translateY";
setAttr ".tan" 10;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 0 75 3.956318995919792 150 8 225 3.6737555068987131
300 0;
setAttr -s 5 ".kit[0:4]" 1 10 9 10 1;
setAttr -s 5 ".kot[0:4]" 1 10 9 10 1;
setAttr -s 5 ".kix[0:4]" 0.99999052286148071 0.61308568716049194
0.99897950887680054 0.61564409732818604 0.99999028444290161;
setAttr -s 5 ".kiy[0:4]" -0.0043685990385711193 0.79001641273498535
-0.045164022594690323 -0.7880244255065918 -0.0044143795967102051;
setAttr -s 5 ".kox[0:4]" 0.99999052286148071 0.61308568716049194
0.99897950887680054 0.61564409732818604 0.99999028444290161;
setAttr -s 5 ".koy[0:4]" -0.0043689887970685959 0.79001641273498535
-0.045164022594690323 -0.7880244255065918 -0.004414659459143877;
createNode animCurveTL -n "dRigidBody1_translateZ";
setAttr ".tan" 9;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 0 75 0 150 0 225 0 300 0;
setAttr -s 5 ".kit[1:4]" 10 9 10 9;
setAttr -s 5 ".kot[1:4]" 10 9 10 9;
createNode animCurveTA -n "dRigidBody1_rotateX";
setAttr ".tan" 9;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 0 75 0 150 0 225 0 300 0;
setAttr -s 5 ".kit[1:4]" 10 9 10 9;
setAttr -s 5 ".kot[1:4]" 10 9 10 9;
createNode animCurveTA -n "dRigidBody1_rotateY";
setAttr ".tan" 9;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 0 75 0 150 0 225 0 300 0;
setAttr -s 5 ".kit[1:4]" 10 9 10 9;
setAttr -s 5 ".kot[1:4]" 10 9 10 9;
createNode animCurveTA -n "dRigidBody1_rotateZ";
setAttr ".tan" 9;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 0 75 0 150 0 225 0 300 0;
setAttr -s 5 ".kit[1:4]" 10 9 10 9;
setAttr -s 5 ".kot[1:4]" 10 9 10 9;
createNode animCurveTU -n "dRigidBody1_scaleX";
setAttr ".tan" 9;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 1 75 1 150 1 225 1 300 1;
setAttr -s 5 ".kit[1:4]" 10 9 10 9;
setAttr -s 5 ".kot[1:4]" 10 9 10 9;
createNode animCurveTU -n "dRigidBody1_scaleY";
setAttr ".tan" 9;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 1 75 1 150 1 225 1 300 1;
setAttr -s 5 ".kit[1:4]" 10 9 10 9;
setAttr -s 5 ".kot[1:4]" 10 9 10 9;
createNode animCurveTU -n "dRigidBody1_scaleZ";
setAttr ".tan" 9;
setAttr ".wgt" no;
setAttr -s 5 ".ktv[0:4]" 1 1 75 1 150 1 225 1 300 1;
setAttr -s 5 ".kit[1:4]" 10 9 10 9;
setAttr -s 5 ".kot[1:4]" 10 9 10 9;
createNode dCollisionShape -n "dCollisionShape2";
setAttr ".tp" 4;
select -ne :time1;
setAttr ".o" 1;
select -ne :renderPartition;
setAttr -s 2 ".st";
select -ne :renderGlobalsList1;
select -ne :defaultShaderList1;
setAttr -s 2 ".s";
select -ne :postProcessList1;
setAttr -s 2 ".p";
select -ne :lightList1;
select -ne :initialShadingGroup;
setAttr ".ro" yes;
select -ne :initialParticleSE;
setAttr ".ro" yes;
select -ne :hardwareRenderGlobals;
setAttr ".ctrs" 256;
setAttr ".btrs" 512;
select -ne :defaultHardwareRenderGlobals;
setAttr ".fn" -type "string" "im";
setAttr ".res" -type "string" "ntsc_4d 646 485 1.333";
connectAttr "dRigidBody1_visibility.o" "dRigidBody1.v";
connectAttr "dRigidBody1_translateX.o" "dRigidBody1.tx";
connectAttr "dRigidBody1_translateY.o" "dRigidBody1.ty";
connectAttr "dRigidBody1_translateZ.o" "dRigidBody1.tz";
connectAttr "dRigidBody1_rotateX.o" "dRigidBody1.rx";
connectAttr "dRigidBody1_rotateY.o" "dRigidBody1.ry";
connectAttr "dRigidBody1_rotateZ.o" "dRigidBody1.rz";
connectAttr "dRigidBody1_scaleX.o" "dRigidBody1.sx";
connectAttr "dRigidBody1_scaleY.o" "dRigidBody1.sy";
connectAttr "dRigidBody1_scaleZ.o" "dRigidBody1.sz";
connectAttr "dSolver1.rbds" "dRigidBodyShape1.solv";
connectAttr "dCollisionShape1.oucs" "dRigidBodyShape1.incs";
connectAttr "dSolver1.rbds" "dRigidBodyShape2.solv";
connectAttr "dCollisionShape2.oucs" "dRigidBodyShape2.incs";
connectAttr "dRigidBodyShape1.msg" "dNailConstraintShape1.inrbA";
connectAttr "dRigidBodyShape2.msg" "dNailConstraintShape1.inrbB";
connectAttr ":defaultLightSet.msg" "lightLinker1.lnk[0].llnk";
connectAttr ":initialShadingGroup.msg" "lightLinker1.lnk[0].olnk";
connectAttr ":defaultLightSet.msg" "lightLinker1.lnk[1].llnk";
connectAttr ":initialParticleSE.msg" "lightLinker1.lnk[1].olnk";
connectAttr ":defaultLightSet.msg" "lightLinker1.slnk[0].sllk";
connectAttr ":initialShadingGroup.msg" "lightLinker1.slnk[0].solk";
connectAttr ":defaultLightSet.msg" "lightLinker1.slnk[1].sllk";
connectAttr ":initialParticleSE.msg" "lightLinker1.slnk[1].solk";
connectAttr "layerManager.dli[0]" "defaultLayer.id";
connectAttr "renderLayerManager.rlmi[0]" "defaultRenderLayer.rlid";
connectAttr ":time1.o" "dSolver1.it";
connectAttr "lightLinker1.msg" ":lightList1.ln" -na;
// End of NailConstraint.ma

View File

@@ -0,0 +1,266 @@
//Maya ASCII 8.5 scene
//Name: SixDofConstraint.ma
//Last modified: Fri, Jan 22, 2010 07:07:31 PM
//Codeset: 1251
requires maya "8.5";
requires "BulletMayaPlugin" "2.76";
currentUnit -l centimeter -a degree -t film;
fileInfo "application" "maya";
fileInfo "product" "Maya Complete 8.5";
fileInfo "version" "8.5 Service Pack 1";
fileInfo "cutIdentifier" "200706062232-700503";
fileInfo "osv" "Microsoft Windows XP Service Pack 2 (Build 2600)\n";
createNode transform -s -n "persp";
setAttr ".v" no;
setAttr ".t" -type "double3" 38.7934523610311 22.233440369487397 3.1212470665275767 ;
setAttr ".r" -type "double3" -29.738352729606959 85.400000000000333 0 ;
createNode camera -s -n "perspShape" -p "persp";
setAttr -k off ".v" no;
setAttr ".fl" 34.999999999999993;
setAttr ".coi" 44.821869662045529;
setAttr ".imn" -type "string" "persp";
setAttr ".den" -type "string" "persp_depth";
setAttr ".man" -type "string" "persp_mask";
setAttr ".hc" -type "string" "viewSet -p %camera";
createNode transform -s -n "top";
setAttr ".v" no;
setAttr ".t" -type "double3" 0 100.1 0 ;
setAttr ".r" -type "double3" -89.999999999999986 0 0 ;
createNode camera -s -n "topShape" -p "top";
setAttr -k off ".v" no;
setAttr ".rnd" no;
setAttr ".coi" 100.1;
setAttr ".ow" 30;
setAttr ".imn" -type "string" "top";
setAttr ".den" -type "string" "top_depth";
setAttr ".man" -type "string" "top_mask";
setAttr ".hc" -type "string" "viewSet -t %camera";
setAttr ".o" yes;
createNode transform -s -n "front";
setAttr ".v" no;
setAttr ".t" -type "double3" 0 0 100.1 ;
createNode camera -s -n "frontShape" -p "front";
setAttr -k off ".v" no;
setAttr ".rnd" no;
setAttr ".coi" 100.1;
setAttr ".ow" 30;
setAttr ".imn" -type "string" "front";
setAttr ".den" -type "string" "front_depth";
setAttr ".man" -type "string" "front_mask";
setAttr ".hc" -type "string" "viewSet -f %camera";
setAttr ".o" yes;
createNode transform -s -n "side";
setAttr ".v" no;
setAttr ".t" -type "double3" 100.1 0 0 ;
setAttr ".r" -type "double3" 0 89.999999999999986 0 ;
createNode camera -s -n "sideShape" -p "side";
setAttr -k off ".v" no;
setAttr ".rnd" no;
setAttr ".coi" 100.1;
setAttr ".ow" 30;
setAttr ".imn" -type "string" "side";
setAttr ".den" -type "string" "side_depth";
setAttr ".man" -type "string" "side_mask";
setAttr ".hc" -type "string" "viewSet -s %camera";
setAttr ".o" yes;
createNode transform -n "dRigidBody1";
createNode dRigidBody -n "dRigidBodyShape1" -p "dRigidBody1";
setAttr -k off ".v";
createNode transform -n "dSixdofConstraint1";
setAttr ".t" -type "double3" -0.99649065732955933 4.7923123802640077e-012 0.91633987426757813 ;
setAttr ".r" -type "double3" 0.020268531926361435 -2.8859679964435921e-010 21.975752322533953 ;
createNode dSixdofConstraint -n "dSixdofConstraintShape1" -p "dSixdofConstraint1";
setAttr -k off ".v";
setAttr ".lllt" -type "float3" -1 0 -1 ;
setAttr ".ullt" -type "float3" 1 0 1 ;
setAttr ".lalt" -type "float3" -15 0 -45 ;
setAttr ".ualt" -type "float3" 15 0 45 ;
setAttr ".hgRotA" -type "float3" 0.020268532 -2.8859681e-010 21.975754 ;
setAttr ".hgRotB" -type "float3" 0.020268532 -2.8859681e-010 21.975754 ;
setAttr ".pivinA" -type "float3" -0.99649066 4.7923124e-012 0.91633987 ;
setAttr ".pivinB" -type "float3" -0.99649066 4.7923124e-012 0.91633987 ;
createNode transform -n "dRigidBody2";
setAttr ".t" -type "double3" 0.74223852157592773 6.148740291595459 -0.69242537021636963 ;
createNode dRigidBody -n "dRigidBodyShape2" -p "dRigidBody2";
setAttr -k off ".v";
setAttr ".inpo" -type "float3" 0.74223852 6.1487403 -0.69242537 ;
createNode transform -n "dRigidBody3";
setAttr ".t" -type "double3" 0 7.4054880142211914 2.8704507350921631 ;
setAttr ".r" -type "double3" 38.55337501544674 0 0 ;
createNode dRigidBody -n "dRigidBodyShape3" -p "dRigidBody3";
setAttr -k off ".v";
setAttr ".inpo" -type "float3" 0 7.405488 2.8704507 ;
setAttr ".inro" -type "float3" 38.553375 0 0 ;
createNode transform -n "dRigidBody4";
setAttr ".t" -type "double3" 0 4.2483773231506348 6.9714751243591309 ;
setAttr ".r" -type "double3" 24.056585370039816 0 0 ;
createNode dRigidBody -n "dRigidBodyShape4" -p "dRigidBody4";
setAttr -k off ".v";
setAttr ".inpo" -type "float3" 0 4.2483773 6.9714751 ;
setAttr ".inro" -type "float3" 24.056585 0 0 ;
createNode transform -n "dSixdofConstraint2";
setAttr ".t" -type "double3" 0 5.5092616081237793 4.3704509735107422 ;
setAttr ".r" -type "double3" 4.7991343788615565e-006 0 0 ;
createNode dSixdofConstraint -n "dSixdofConstraintShape2" -p "dSixdofConstraint2";
setAttr -k off ".v";
setAttr ".lllt" -type "float3" -0.5 -0.5 -0.5 ;
setAttr ".ullt" -type "float3" 0.5 0.5 0 ;
setAttr ".lalt" -type "float3" -45 -45 -45 ;
setAttr ".ualt" -type "float3" 45 45 0 ;
setAttr ".hgRotA" -type "float3" -38.553368 0 0 ;
setAttr ".hgRotB" -type "float3" -24.05658 0 0 ;
setAttr ".pivinA" -type "float3" 0 -0.54803658 2.3548527 ;
setAttr ".pivinB" -type "float3" 0 0.091089725 -2.8890934 ;
createNode transform -n "dRigidBody5";
setAttr ".t" -type "double3" 0 -0.65094339622641306 0 ;
createNode dRigidBody -n "dRigidBodyShape5" -p "dRigidBody5";
setAttr -k off ".v";
setAttr ".ma" 0;
setAttr ".inpo" -type "float3" 0 -0.6509434 0 ;
createNode transform -n "dRigidBody6";
setAttr ".t" -type "double3" 0 8.2075471698113187 -7.7547169811320753 ;
createNode dRigidBody -n "dRigidBodyShape6" -p "dRigidBody6";
setAttr -k off ".v";
setAttr ".ma" 0;
setAttr ".inpo" -type "float3" 0 8.2075472 -7.7547169 ;
createNode transform -n "dRigidBody7";
setAttr ".t" -type "double3" 0 5.9150943756103516 -12.708039283752441 ;
createNode dRigidBody -n "dRigidBodyShape7" -p "dRigidBody7";
setAttr -k off ".v";
setAttr ".inpo" -type "float3" 0 5.9150944 -12.708039 ;
createNode transform -n "dSixdofConstraint3";
setAttr ".t" -type "double3" 0 8.2075471878051758 -7.7547168731689453 ;
createNode dSixdofConstraint -n "dSixdofConstraintShape3" -p "dSixdofConstraint3";
setAttr -k off ".v";
setAttr ".lalt" -type "float3" 1 0 0 ;
setAttr ".ualt" -type "float3" 0 0 -1 ;
setAttr ".pivinB" -type "float3" 0 2.2924528 4.9533224 ;
createNode lightLinker -n "lightLinker1";
setAttr -s 2 ".lnk";
setAttr -s 2 ".slnk";
createNode displayLayerManager -n "layerManager";
createNode displayLayer -n "defaultLayer";
createNode renderLayerManager -n "renderLayerManager";
createNode renderLayer -n "defaultRenderLayer";
setAttr ".g" yes;
createNode dSolver -n "dSolver1";
setAttr ".grvt" -type "float3" 1.4012985e-045 -9.8100004 0 ;
createNode dCollisionShape -n "dCollisionShape1";
setAttr ".tp" 4;
createNode dCollisionShape -n "dCollisionShape2";
setAttr ".tp" 4;
createNode script -n "uiConfigurationScriptNode";
setAttr ".b" -type "string" (
"// Maya Mel UI Configuration File.\n//\n// This script is machine generated. Edit at your own risk.\n//\n//\n\nglobal string $gMainPane;\nif (`paneLayout -exists $gMainPane`) {\n\n\tglobal int $gUseScenePanelConfig;\n\tint $useSceneConfig = $gUseScenePanelConfig;\n\tint $menusOkayInPanels = `optionVar -q allowMenusInPanels`;\tint $nVisPanes = `paneLayout -q -nvp $gMainPane`;\n\tint $nPanes = 0;\n\tstring $editorName;\n\tstring $panelName;\n\tstring $itemFilterName;\n\tstring $panelConfig;\n\n\t//\n\t// get current state of the UI\n\t//\n\tsceneUIReplacement -update $gMainPane;\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Top View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Top View\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"top\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n"
+ " -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n"
+ " -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n"
+ " -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Top View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"top\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n"
+ " -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n"
+ " -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Side View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Side View\")) -mbv $menusOkayInPanels `;\n"
+ "\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"side\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n"
+ " -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n"
+ " -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Side View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"side\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n"
+ " -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n"
+ " -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Front View\")) `;\n"
+ "\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Front View\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"front\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n"
+ " -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n"
+ " -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Front View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"front\" \n -useInteractiveMode 0\n -displayLights \"default\" \n"
+ " -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n"
+ " -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n"
+ " -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Persp View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Persp View\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"persp\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n"
+ " -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n"
+ " -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n"
+ "\t\tmodelPanel -edit -l (localizedPanelLabel(\"Persp View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"persp\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n"
+ " -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n"
+ " -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"outlinerPanel\" (localizedPanelLabel(\"Outliner\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `outlinerPanel -unParent -l (localizedPanelLabel(\"Outliner\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n outlinerEditor -e \n -showShapes 0\n -showAttributes 0\n -showConnected 0\n -showAnimCurvesOnly 0\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 1\n -ignoreDagHierarchy 0\n -expandConnections 0\n"
+ " -showUnitlessCurves 1\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 0\n -highlightActive 1\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"defaultSetFilter\" \n -showSetMembers 1\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n"
+ "\t\toutlinerPanel -edit -l (localizedPanelLabel(\"Outliner\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n outlinerEditor -e \n -showShapes 0\n -showAttributes 0\n -showConnected 0\n -showAnimCurvesOnly 0\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 1\n -ignoreDagHierarchy 0\n -expandConnections 0\n -showUnitlessCurves 1\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 0\n -highlightActive 1\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"defaultSetFilter\" \n -showSetMembers 1\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n"
+ " -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"graphEditor\" (localizedPanelLabel(\"Graph Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"graphEditor\" -l (localizedPanelLabel(\"Graph Editor\")) -mbv $menusOkayInPanels `;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 1\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n -showUnitlessCurves 1\n"
+ " -showCompounds 0\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 1\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 1\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"GraphEd\");\n animCurveEditor -e \n -displayKeys 1\n"
+ " -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 1\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -showResults \"off\" \n -showBufferCurves \"off\" \n -smoothness \"fine\" \n -resultSamples 1\n -resultScreenSamples 0\n -resultUpdate \"delayed\" \n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Graph Editor\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 1\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n"
+ " -showUnitlessCurves 1\n -showCompounds 0\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 1\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 1\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"GraphEd\");\n animCurveEditor -e \n"
+ " -displayKeys 1\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 1\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -showResults \"off\" \n -showBufferCurves \"off\" \n -smoothness \"fine\" \n -resultSamples 1\n -resultScreenSamples 0\n -resultUpdate \"delayed\" \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dopeSheetPanel\" (localizedPanelLabel(\"Dope Sheet\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"dopeSheetPanel\" -l (localizedPanelLabel(\"Dope Sheet\")) -mbv $menusOkayInPanels `;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n"
+ " -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n -showUnitlessCurves 0\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 1\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n"
+ " -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"DopeSheetEd\");\n dopeSheetEditor -e \n -displayKeys 1\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -outliner \"dopeSheetPanel1OutlineEd\" \n -showSummary 1\n -showScene 0\n -hierarchyBelow 0\n -showTicks 1\n -selectionWindow 0 0 0 0 \n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Dope Sheet\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n"
+ " -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n -showUnitlessCurves 0\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 1\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n"
+ " -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"DopeSheetEd\");\n dopeSheetEditor -e \n -displayKeys 1\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -outliner \"dopeSheetPanel1OutlineEd\" \n -showSummary 1\n -showScene 0\n -hierarchyBelow 0\n -showTicks 1\n -selectionWindow 0 0 0 0 \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"clipEditorPanel\" (localizedPanelLabel(\"Trax Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"clipEditorPanel\" -l (localizedPanelLabel(\"Trax Editor\")) -mbv $menusOkayInPanels `;\n"
+ "\t\t\t$editorName = clipEditorNameFromPanel($panelName);\n clipEditor -e \n -displayKeys 0\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"none\" \n -snapValue \"none\" \n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Trax Editor\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = clipEditorNameFromPanel($panelName);\n clipEditor -e \n -displayKeys 0\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"none\" \n -snapValue \"none\" \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"hyperGraphPanel\" (localizedPanelLabel(\"Hypergraph Hierarchy\")) `;\n"
+ "\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"hyperGraphPanel\" -l (localizedPanelLabel(\"Hypergraph Hierarchy\")) -mbv $menusOkayInPanels `;\n\n\t\t\t$editorName = ($panelName+\"HyperGraphEd\");\n hyperGraph -e \n -graphLayoutStyle \"hierarchicalLayout\" \n -orientation \"horiz\" \n -zoom 1\n -animateTransition 0\n -showShapes 0\n -showDeformers 0\n -showExpressions 0\n -showConstraints 0\n -showUnderworld 0\n -showInvisible 0\n -transitionFrames 1\n -freeform 0\n -imagePosition 0 0 \n -imageScale 1\n -imageEnabled 0\n -graphType \"DAG\" \n -updateSelection 1\n -updateNodeAdded 1\n -useDrawOverrideColor 0\n -limitGraphTraversal -1\n -iconSize \"smallIcons\" \n -showCachedConnections 0\n"
+ " $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Hypergraph Hierarchy\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"HyperGraphEd\");\n hyperGraph -e \n -graphLayoutStyle \"hierarchicalLayout\" \n -orientation \"horiz\" \n -zoom 1\n -animateTransition 0\n -showShapes 0\n -showDeformers 0\n -showExpressions 0\n -showConstraints 0\n -showUnderworld 0\n -showInvisible 0\n -transitionFrames 1\n -freeform 0\n -imagePosition 0 0 \n -imageScale 1\n -imageEnabled 0\n -graphType \"DAG\" \n -updateSelection 1\n -updateNodeAdded 1\n -useDrawOverrideColor 0\n -limitGraphTraversal -1\n -iconSize \"smallIcons\" \n -showCachedConnections 0\n"
+ " $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"hyperShadePanel\" (localizedPanelLabel(\"Hypershade\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"hyperShadePanel\" -l (localizedPanelLabel(\"Hypershade\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Hypershade\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"visorPanel\" (localizedPanelLabel(\"Visor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"visorPanel\" -l (localizedPanelLabel(\"Visor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Visor\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"polyTexturePlacementPanel\" (localizedPanelLabel(\"UV Texture Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"polyTexturePlacementPanel\" -l (localizedPanelLabel(\"UV Texture Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"UV Texture Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"multiListerPanel\" (localizedPanelLabel(\"Multilister\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"multiListerPanel\" -l (localizedPanelLabel(\"Multilister\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Multilister\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"renderWindowPanel\" (localizedPanelLabel(\"Render View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"renderWindowPanel\" -l (localizedPanelLabel(\"Render View\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Render View\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"blendShapePanel\" (localizedPanelLabel(\"Blend Shape\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\tblendShapePanel -unParent -l (localizedPanelLabel(\"Blend Shape\")) -mbv $menusOkayInPanels ;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tblendShapePanel -edit -l (localizedPanelLabel(\"Blend Shape\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n"
+ "\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dynRelEdPanel\" (localizedPanelLabel(\"Dynamic Relationships\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"dynRelEdPanel\" -l (localizedPanelLabel(\"Dynamic Relationships\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Dynamic Relationships\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"devicePanel\" (localizedPanelLabel(\"Devices\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\tdevicePanel -unParent -l (localizedPanelLabel(\"Devices\")) -mbv $menusOkayInPanels ;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tdevicePanel -edit -l (localizedPanelLabel(\"Devices\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n"
+ "\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"relationshipPanel\" (localizedPanelLabel(\"Relationship Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"relationshipPanel\" -l (localizedPanelLabel(\"Relationship Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Relationship Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"referenceEditorPanel\" (localizedPanelLabel(\"Reference Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"referenceEditorPanel\" -l (localizedPanelLabel(\"Reference Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Reference Editor\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"componentEditorPanel\" (localizedPanelLabel(\"Component Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"componentEditorPanel\" -l (localizedPanelLabel(\"Component Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Component Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dynPaintScriptedPanelType\" (localizedPanelLabel(\"Paint Effects\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"dynPaintScriptedPanelType\" -l (localizedPanelLabel(\"Paint Effects\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Paint Effects\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"webBrowserPanel\" (localizedPanelLabel(\"Web Browser\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"webBrowserPanel\" -l (localizedPanelLabel(\"Web Browser\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Web Browser\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"scriptEditorPanel\" (localizedPanelLabel(\"Script Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"scriptEditorPanel\" -l (localizedPanelLabel(\"Script Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Script Editor\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\tif ($useSceneConfig) {\n string $configName = `getPanel -cwl (localizedPanelLabel(\"Current Layout\"))`;\n if (\"\" != $configName) {\n\t\t\tpanelConfiguration -edit -label (localizedPanelLabel(\"Current Layout\")) \n\t\t\t\t-defaultImage \"\"\n\t\t\t\t-image \"\"\n\t\t\t\t-sc false\n\t\t\t\t-configString \"global string $gMainPane; paneLayout -e -cn \\\"single\\\" -ps 1 100 100 $gMainPane;\"\n\t\t\t\t-removeAllPanels\n\t\t\t\t-ap false\n\t\t\t\t\t(localizedPanelLabel(\"Persp View\")) \n\t\t\t\t\t\"modelPanel\"\n"
+ "\t\t\t\t\t\"$panelName = `modelPanel -unParent -l (localizedPanelLabel(\\\"Persp View\\\")) -mbv $menusOkayInPanels `;\\n$editorName = $panelName;\\nmodelEditor -e \\n -cam `findStartUpCamera persp` \\n -useInteractiveMode 0\\n -displayLights \\\"default\\\" \\n -displayAppearance \\\"wireframe\\\" \\n -activeOnly 0\\n -wireframeOnShaded 0\\n -headsUpDisplay 1\\n -selectionHiliteDisplay 1\\n -useDefaultMaterial 0\\n -bufferMode \\\"double\\\" \\n -twoSidedLighting 1\\n -backfaceCulling 0\\n -xray 0\\n -displayTextures 0\\n -smoothWireframe 0\\n -textureAnisotropic 0\\n -textureHilight 1\\n -textureSampling 2\\n -textureDisplay \\\"modulate\\\" \\n -textureMaxSize 8192\\n -fogging 0\\n -fogSource \\\"fragment\\\" \\n -fogMode \\\"linear\\\" \\n -fogStart 0\\n -fogEnd 100\\n -fogDensity 0.1\\n -fogColor 0.5 0.5 0.5 1 \\n -maxConstantTransparency 1\\n -rendererName \\\"base_OpenGL_Renderer\\\" \\n -colorResolution 256 256 \\n -bumpResolution 512 512 \\n -textureCompression 0\\n -transparencyAlgorithm \\\"frontAndBackCull\\\" \\n -transpInShadows 0\\n -cullingOverride \\\"none\\\" \\n -lowQualityLighting 0\\n -maximumNumHardwareLights 1\\n -occlusionCulling 0\\n -useBaseRenderer 0\\n -useReducedRenderer 0\\n -smallObjectCulling 0\\n -smallObjectThreshold -1 \\n -interactiveDisableShadows 0\\n -interactiveBackFaceCull 0\\n -sortTransparent 1\\n -nurbsCurves 1\\n -nurbsSurfaces 1\\n -polymeshes 1\\n -subdivSurfaces 1\\n -planes 1\\n -lights 1\\n -cameras 1\\n -controlVertices 1\\n -hulls 1\\n -grid 1\\n -joints 1\\n -ikHandles 1\\n -deformers 1\\n -dynamics 1\\n -fluids 1\\n -hairSystems 1\\n -follicles 1\\n -nCloths 1\\n -nRigids 1\\n -dynamicConstraints 1\\n -locators 1\\n -manipulators 1\\n -dimensions 1\\n -handles 1\\n -pivots 1\\n -textures 1\\n -strokes 1\\n -shadows 0\\n $editorName;\\nmodelEditor -e -viewSelected 0 $editorName\"\n"
+ "\t\t\t\t\t\"modelPanel -edit -l (localizedPanelLabel(\\\"Persp View\\\")) -mbv $menusOkayInPanels $panelName;\\n$editorName = $panelName;\\nmodelEditor -e \\n -cam `findStartUpCamera persp` \\n -useInteractiveMode 0\\n -displayLights \\\"default\\\" \\n -displayAppearance \\\"wireframe\\\" \\n -activeOnly 0\\n -wireframeOnShaded 0\\n -headsUpDisplay 1\\n -selectionHiliteDisplay 1\\n -useDefaultMaterial 0\\n -bufferMode \\\"double\\\" \\n -twoSidedLighting 1\\n -backfaceCulling 0\\n -xray 0\\n -displayTextures 0\\n -smoothWireframe 0\\n -textureAnisotropic 0\\n -textureHilight 1\\n -textureSampling 2\\n -textureDisplay \\\"modulate\\\" \\n -textureMaxSize 8192\\n -fogging 0\\n -fogSource \\\"fragment\\\" \\n -fogMode \\\"linear\\\" \\n -fogStart 0\\n -fogEnd 100\\n -fogDensity 0.1\\n -fogColor 0.5 0.5 0.5 1 \\n -maxConstantTransparency 1\\n -rendererName \\\"base_OpenGL_Renderer\\\" \\n -colorResolution 256 256 \\n -bumpResolution 512 512 \\n -textureCompression 0\\n -transparencyAlgorithm \\\"frontAndBackCull\\\" \\n -transpInShadows 0\\n -cullingOverride \\\"none\\\" \\n -lowQualityLighting 0\\n -maximumNumHardwareLights 1\\n -occlusionCulling 0\\n -useBaseRenderer 0\\n -useReducedRenderer 0\\n -smallObjectCulling 0\\n -smallObjectThreshold -1 \\n -interactiveDisableShadows 0\\n -interactiveBackFaceCull 0\\n -sortTransparent 1\\n -nurbsCurves 1\\n -nurbsSurfaces 1\\n -polymeshes 1\\n -subdivSurfaces 1\\n -planes 1\\n -lights 1\\n -cameras 1\\n -controlVertices 1\\n -hulls 1\\n -grid 1\\n -joints 1\\n -ikHandles 1\\n -deformers 1\\n -dynamics 1\\n -fluids 1\\n -hairSystems 1\\n -follicles 1\\n -nCloths 1\\n -nRigids 1\\n -dynamicConstraints 1\\n -locators 1\\n -manipulators 1\\n -dimensions 1\\n -handles 1\\n -pivots 1\\n -textures 1\\n -strokes 1\\n -shadows 0\\n $editorName;\\nmodelEditor -e -viewSelected 0 $editorName\"\n"
+ "\t\t\t\t$configName;\n\n setNamedPanelLayout (localizedPanelLabel(\"Current Layout\"));\n }\n\n panelHistory -e -clear mainPanelHistory;\n setFocus `paneLayout -q -p1 $gMainPane`;\n sceneUIReplacement -deleteRemaining;\n sceneUIReplacement -clear;\n\t}\n\n\ngrid -spacing 5 -size 12 -divisions 5 -displayAxes yes -displayGridLines yes -displayDivisionLines yes -displayPerspectiveLabels no -displayOrthographicLabels no -displayAxesBold yes -perspectiveLabelPosition axis -orthographicLabelPosition edge;\n}\n");
setAttr ".st" 3;
createNode script -n "sceneConfigurationScriptNode";
setAttr ".b" -type "string" "playbackOptions -min 1 -max 100 -ast 1 -aet 100 ";
setAttr ".st" 6;
createNode dCollisionShape -n "dCollisionShape3";
setAttr ".tp" 4;
createNode dCollisionShape -n "dCollisionShape4";
setAttr ".tp" 4;
createNode dCollisionShape -n "dCollisionShape5";
setAttr ".tp" 6;
createNode dCollisionShape -n "dCollisionShape6";
setAttr ".tp" 4;
createNode dCollisionShape -n "dCollisionShape7";
setAttr ".tp" 4;
select -ne :time1;
setAttr ".o" 1;
select -ne :renderPartition;
setAttr -s 2 ".st";
select -ne :renderGlobalsList1;
select -ne :defaultShaderList1;
setAttr -s 2 ".s";
select -ne :postProcessList1;
setAttr -s 2 ".p";
select -ne :lightList1;
select -ne :initialShadingGroup;
setAttr ".ro" yes;
select -ne :initialParticleSE;
setAttr ".ro" yes;
select -ne :hardwareRenderGlobals;
setAttr ".ctrs" 256;
setAttr ".btrs" 512;
select -ne :defaultHardwareRenderGlobals;
setAttr ".fn" -type "string" "im";
setAttr ".res" -type "string" "ntsc_4d 646 485 1.333";
connectAttr "dSolver1.rbds" "dRigidBodyShape1.solv";
connectAttr "dCollisionShape1.oucs" "dRigidBodyShape1.incs";
connectAttr "dRigidBodyShape1.msg" "dSixdofConstraintShape1.inrbA";
connectAttr "dSolver1.rbds" "dRigidBodyShape2.solv";
connectAttr "dCollisionShape2.oucs" "dRigidBodyShape2.incs";
connectAttr "dSolver1.rbds" "dRigidBodyShape3.solv";
connectAttr "dCollisionShape3.oucs" "dRigidBodyShape3.incs";
connectAttr "dSolver1.rbds" "dRigidBodyShape4.solv";
connectAttr "dCollisionShape4.oucs" "dRigidBodyShape4.incs";
connectAttr "dRigidBodyShape3.msg" "dSixdofConstraintShape2.inrbA";
connectAttr "dRigidBodyShape4.msg" "dSixdofConstraintShape2.inrbB";
connectAttr "dSolver1.rbds" "dRigidBodyShape5.solv";
connectAttr "dCollisionShape5.oucs" "dRigidBodyShape5.incs";
connectAttr "dSolver1.rbds" "dRigidBodyShape6.solv";
connectAttr "dCollisionShape6.oucs" "dRigidBodyShape6.incs";
connectAttr "dSolver1.rbds" "dRigidBodyShape7.solv";
connectAttr "dCollisionShape7.oucs" "dRigidBodyShape7.incs";
connectAttr "dRigidBodyShape6.msg" "dSixdofConstraintShape3.inrbA";
connectAttr "dRigidBodyShape7.msg" "dSixdofConstraintShape3.inrbB";
connectAttr ":defaultLightSet.msg" "lightLinker1.lnk[0].llnk";
connectAttr ":initialShadingGroup.msg" "lightLinker1.lnk[0].olnk";
connectAttr ":defaultLightSet.msg" "lightLinker1.lnk[1].llnk";
connectAttr ":initialParticleSE.msg" "lightLinker1.lnk[1].olnk";
connectAttr ":defaultLightSet.msg" "lightLinker1.slnk[0].sllk";
connectAttr ":initialShadingGroup.msg" "lightLinker1.slnk[0].solk";
connectAttr ":defaultLightSet.msg" "lightLinker1.slnk[1].sllk";
connectAttr ":initialParticleSE.msg" "lightLinker1.slnk[1].solk";
connectAttr "layerManager.dli[0]" "defaultLayer.id";
connectAttr "renderLayerManager.rlmi[0]" "defaultRenderLayer.rlid";
connectAttr ":time1.o" "dSolver1.it";
connectAttr "lightLinker1.msg" ":lightList1.ln" -na;
// End of SixDofConstraint.ma

View File

@@ -0,0 +1,210 @@
//Maya ASCII 8.5 scene
//Name: SliderConstraint.ma
//Last modified: Fri, Jan 22, 2010 07:06:26 PM
//Codeset: 1251
requires maya "8.5";
requires "BulletMayaPlugin" "2.76";
currentUnit -l centimeter -a degree -t film;
fileInfo "application" "maya";
fileInfo "product" "Maya Complete 8.5";
fileInfo "version" "8.5 Service Pack 1";
fileInfo "cutIdentifier" "200706062232-700503";
fileInfo "osv" "Microsoft Windows XP Service Pack 2 (Build 2600)\n";
createNode transform -s -n "persp";
setAttr ".v" no;
setAttr ".t" -type "double3" -1.121862257366864 9.5410966355411908 45.903699744377633 ;
setAttr ".r" -type "double3" -11.738352729606017 -1.3999999999977073 -2.7341053377653525e-016 ;
createNode camera -s -n "perspShape" -p "persp";
setAttr -k off ".v" no;
setAttr ".fl" 34.999999999999993;
setAttr ".coi" 46.898195595940187;
setAttr ".imn" -type "string" "persp";
setAttr ".den" -type "string" "persp_depth";
setAttr ".man" -type "string" "persp_mask";
setAttr ".hc" -type "string" "viewSet -p %camera";
createNode transform -s -n "top";
setAttr ".v" no;
setAttr ".t" -type "double3" 0 100.1 0 ;
setAttr ".r" -type "double3" -89.999999999999986 0 0 ;
createNode camera -s -n "topShape" -p "top";
setAttr -k off ".v" no;
setAttr ".rnd" no;
setAttr ".coi" 100.1;
setAttr ".ow" 30;
setAttr ".imn" -type "string" "top";
setAttr ".den" -type "string" "top_depth";
setAttr ".man" -type "string" "top_mask";
setAttr ".hc" -type "string" "viewSet -t %camera";
setAttr ".o" yes;
createNode transform -s -n "front";
setAttr ".v" no;
setAttr ".t" -type "double3" 0.16846184179137066 5.585157985544674 100.1 ;
createNode camera -s -n "frontShape" -p "front";
setAttr -k off ".v" no;
setAttr ".rnd" no;
setAttr ".coi" 100.1;
setAttr ".ow" 37.126971335603372;
setAttr ".imn" -type "string" "front";
setAttr ".den" -type "string" "front_depth";
setAttr ".man" -type "string" "front_mask";
setAttr ".hc" -type "string" "viewSet -f %camera";
setAttr ".o" yes;
createNode transform -s -n "side";
setAttr ".v" no;
setAttr ".t" -type "double3" 100.1 0 0 ;
setAttr ".r" -type "double3" 0 89.999999999999986 0 ;
createNode camera -s -n "sideShape" -p "side";
setAttr -k off ".v" no;
setAttr ".rnd" no;
setAttr ".coi" 100.1;
setAttr ".ow" 30;
setAttr ".imn" -type "string" "side";
setAttr ".den" -type "string" "side_depth";
setAttr ".man" -type "string" "side_mask";
setAttr ".hc" -type "string" "viewSet -s %camera";
setAttr ".o" yes;
createNode transform -n "dRigidBody3";
createNode dRigidBody -n "dRigidBodyShape3" -p "dRigidBody3";
setAttr -k off ".v";
setAttr ".ma" 0;
createNode transform -n "dRigidBody4";
setAttr ".t" -type "double3" 0 10 0 ;
createNode dRigidBody -n "dRigidBodyShape4" -p "dRigidBody4";
setAttr -k off ".v";
setAttr ".inpo" -type "float3" 0 10 0 ;
createNode transform -n "dRigidBody5";
setAttr ".t" -type "double3" 0 6 0 ;
setAttr ".r" -type "double3" -0.073827534748987664 39.413452926302256 -0.31976101560540626 ;
createNode dRigidBody -n "dRigidBodyShape5" -p "dRigidBody5";
setAttr -k off ".v";
setAttr ".inpo" -type "float3" 0 6 0 ;
setAttr ".inro" -type "float3" -0.073827535 39.413452 -0.31976101 ;
createNode transform -n "dSliderConstraint1";
setAttr ".t" -type "double3" 0 6 0 ;
setAttr ".r" -type "double3" -1.5681541670487501e-005 -3.9008264880987513e-007 90.000019318692708 ;
createNode dSliderConstraint -n "dSliderConstraintShape1" -p "dSliderConstraint1";
setAttr -k off ".v";
setAttr ".lllt" -2;
setAttr ".ullt" 1;
setAttr ".hgRotA" -type "float3" -39.413353 0.12920605 90.247055 ;
setAttr ".hgRotB" -type "float3" -1.5681544e-005 -8.1074069e-013 90.000015 ;
setAttr ".pivinB" -type "float3" 0 -4 0 ;
createNode transform -n "dRigidBody6";
setAttr ".t" -type "double3" 0.66548347473144531 1.190865159034729 0 ;
createNode dRigidBody -n "dRigidBodyShape6" -p "dRigidBody6";
setAttr -k off ".v";
setAttr ".inpo" -type "float3" 0.66548347 1.1908652 0 ;
createNode lightLinker -n "lightLinker1";
setAttr -s 2 ".lnk";
setAttr -s 2 ".slnk";
createNode displayLayerManager -n "layerManager";
createNode displayLayer -n "defaultLayer";
createNode renderLayerManager -n "renderLayerManager";
createNode renderLayer -n "defaultRenderLayer";
setAttr ".g" yes;
createNode dSolver -n "dSolver1";
setAttr ".grvt" -type "float3" 1.4012985e-045 -9.8100004 0 ;
createNode dCollisionShape -n "dCollisionShape3";
setAttr ".tp" 6;
createNode dCollisionShape -n "dCollisionShape4";
setAttr ".tp" 4;
createNode dCollisionShape -n "dCollisionShape5";
setAttr ".tp" 4;
createNode dCollisionShape -n "dCollisionShape6";
setAttr ".tp" 4;
createNode script -n "uiConfigurationScriptNode";
setAttr ".b" -type "string" (
"// Maya Mel UI Configuration File.\n//\n// This script is machine generated. Edit at your own risk.\n//\n//\n\nglobal string $gMainPane;\nif (`paneLayout -exists $gMainPane`) {\n\n\tglobal int $gUseScenePanelConfig;\n\tint $useSceneConfig = $gUseScenePanelConfig;\n\tint $menusOkayInPanels = `optionVar -q allowMenusInPanels`;\tint $nVisPanes = `paneLayout -q -nvp $gMainPane`;\n\tint $nPanes = 0;\n\tstring $editorName;\n\tstring $panelName;\n\tstring $itemFilterName;\n\tstring $panelConfig;\n\n\t//\n\t// get current state of the UI\n\t//\n\tsceneUIReplacement -update $gMainPane;\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Top View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Top View\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"top\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n"
+ " -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n"
+ " -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n"
+ " -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Top View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"top\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n"
+ " -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n"
+ " -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Side View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Side View\")) -mbv $menusOkayInPanels `;\n"
+ "\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"side\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n"
+ " -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n"
+ " -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Side View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"side\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n"
+ " -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n"
+ " -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Front View\")) `;\n"
+ "\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Front View\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"front\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n"
+ " -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n"
+ " -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tmodelPanel -edit -l (localizedPanelLabel(\"Front View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"front\" \n -useInteractiveMode 0\n -displayLights \"default\" \n"
+ " -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n"
+ " -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n"
+ " -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"modelPanel\" (localizedPanelLabel(\"Persp View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `modelPanel -unParent -l (localizedPanelLabel(\"Persp View\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"persp\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n"
+ " -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n"
+ " -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n"
+ "\t\tmodelPanel -edit -l (localizedPanelLabel(\"Persp View\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n modelEditor -e \n -camera \"persp\" \n -useInteractiveMode 0\n -displayLights \"default\" \n -displayAppearance \"wireframe\" \n -activeOnly 0\n -wireframeOnShaded 0\n -headsUpDisplay 1\n -selectionHiliteDisplay 1\n -useDefaultMaterial 0\n -bufferMode \"double\" \n -twoSidedLighting 1\n -backfaceCulling 0\n -xray 0\n -displayTextures 0\n -smoothWireframe 0\n -textureAnisotropic 0\n -textureHilight 1\n -textureSampling 2\n -textureDisplay \"modulate\" \n -textureMaxSize 8192\n -fogging 0\n -fogSource \"fragment\" \n -fogMode \"linear\" \n -fogStart 0\n -fogEnd 100\n -fogDensity 0.1\n -fogColor 0.5 0.5 0.5 1 \n -maxConstantTransparency 1\n"
+ " -rendererName \"base_OpenGL_Renderer\" \n -colorResolution 256 256 \n -bumpResolution 512 512 \n -textureCompression 0\n -transparencyAlgorithm \"frontAndBackCull\" \n -transpInShadows 0\n -cullingOverride \"none\" \n -lowQualityLighting 0\n -maximumNumHardwareLights 1\n -occlusionCulling 0\n -useBaseRenderer 0\n -useReducedRenderer 0\n -smallObjectCulling 0\n -smallObjectThreshold -1 \n -interactiveDisableShadows 0\n -interactiveBackFaceCull 0\n -sortTransparent 1\n -nurbsCurves 1\n -nurbsSurfaces 1\n -polymeshes 1\n -subdivSurfaces 1\n -planes 1\n -lights 1\n -cameras 1\n -controlVertices 1\n -hulls 1\n -grid 1\n -joints 1\n -ikHandles 1\n -deformers 1\n -dynamics 1\n -fluids 1\n -hairSystems 1\n"
+ " -follicles 1\n -nCloths 1\n -nRigids 1\n -dynamicConstraints 1\n -locators 1\n -manipulators 1\n -dimensions 1\n -handles 1\n -pivots 1\n -textures 1\n -strokes 1\n -shadows 0\n $editorName;\nmodelEditor -e -viewSelected 0 $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"outlinerPanel\" (localizedPanelLabel(\"Outliner\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `outlinerPanel -unParent -l (localizedPanelLabel(\"Outliner\")) -mbv $menusOkayInPanels `;\n\t\t\t$editorName = $panelName;\n outlinerEditor -e \n -showShapes 0\n -showAttributes 0\n -showConnected 0\n -showAnimCurvesOnly 0\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 1\n -ignoreDagHierarchy 0\n -expandConnections 0\n"
+ " -showUnitlessCurves 1\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 0\n -highlightActive 1\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"defaultSetFilter\" \n -showSetMembers 1\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n"
+ "\t\toutlinerPanel -edit -l (localizedPanelLabel(\"Outliner\")) -mbv $menusOkayInPanels $panelName;\n\t\t$editorName = $panelName;\n outlinerEditor -e \n -showShapes 0\n -showAttributes 0\n -showConnected 0\n -showAnimCurvesOnly 0\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 1\n -ignoreDagHierarchy 0\n -expandConnections 0\n -showUnitlessCurves 1\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 0\n -highlightActive 1\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"defaultSetFilter\" \n -showSetMembers 1\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n"
+ " -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"graphEditor\" (localizedPanelLabel(\"Graph Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"graphEditor\" -l (localizedPanelLabel(\"Graph Editor\")) -mbv $menusOkayInPanels `;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 1\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n -showUnitlessCurves 1\n"
+ " -showCompounds 0\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 1\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 1\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"GraphEd\");\n animCurveEditor -e \n -displayKeys 1\n"
+ " -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 1\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -showResults \"off\" \n -showBufferCurves \"off\" \n -smoothness \"fine\" \n -resultSamples 1\n -resultScreenSamples 0\n -resultUpdate \"delayed\" \n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Graph Editor\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 1\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n"
+ " -showUnitlessCurves 1\n -showCompounds 0\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 1\n -doNotSelectNewObjects 0\n -dropIsParent 1\n -transmitFilters 1\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"GraphEd\");\n animCurveEditor -e \n"
+ " -displayKeys 1\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 1\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -showResults \"off\" \n -showBufferCurves \"off\" \n -smoothness \"fine\" \n -resultSamples 1\n -resultScreenSamples 0\n -resultUpdate \"delayed\" \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dopeSheetPanel\" (localizedPanelLabel(\"Dope Sheet\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"dopeSheetPanel\" -l (localizedPanelLabel(\"Dope Sheet\")) -mbv $menusOkayInPanels `;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n"
+ " -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n -showUnitlessCurves 0\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 1\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n"
+ " -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"DopeSheetEd\");\n dopeSheetEditor -e \n -displayKeys 1\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -outliner \"dopeSheetPanel1OutlineEd\" \n -showSummary 1\n -showScene 0\n -hierarchyBelow 0\n -showTicks 1\n -selectionWindow 0 0 0 0 \n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Dope Sheet\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"OutlineEd\");\n outlinerEditor -e \n -showShapes 1\n -showAttributes 1\n"
+ " -showConnected 1\n -showAnimCurvesOnly 1\n -showMuteInfo 0\n -autoExpand 0\n -showDagOnly 0\n -ignoreDagHierarchy 0\n -expandConnections 1\n -showUnitlessCurves 0\n -showCompounds 1\n -showLeafs 1\n -showNumericAttrsOnly 1\n -highlightActive 0\n -autoSelectNewObjects 0\n -doNotSelectNewObjects 1\n -dropIsParent 1\n -transmitFilters 0\n -setFilter \"0\" \n -showSetMembers 0\n -allowMultiSelection 1\n -alwaysToggleSelect 0\n -directSelect 0\n -displayMode \"DAG\" \n -expandObjects 0\n -setsIgnoreFilters 1\n -editAttrName 0\n -showAttrValues 0\n -highlightSecondary 0\n -showUVAttrsOnly 0\n -showTextureNodesOnly 0\n -attrAlphaOrder \"default\" \n"
+ " -sortOrder \"none\" \n -longNames 0\n -niceNames 1\n -showNamespace 1\n $editorName;\n\n\t\t\t$editorName = ($panelName+\"DopeSheetEd\");\n dopeSheetEditor -e \n -displayKeys 1\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"integer\" \n -snapValue \"none\" \n -outliner \"dopeSheetPanel1OutlineEd\" \n -showSummary 1\n -showScene 0\n -hierarchyBelow 0\n -showTicks 1\n -selectionWindow 0 0 0 0 \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"clipEditorPanel\" (localizedPanelLabel(\"Trax Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"clipEditorPanel\" -l (localizedPanelLabel(\"Trax Editor\")) -mbv $menusOkayInPanels `;\n"
+ "\t\t\t$editorName = clipEditorNameFromPanel($panelName);\n clipEditor -e \n -displayKeys 0\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"none\" \n -snapValue \"none\" \n $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Trax Editor\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = clipEditorNameFromPanel($panelName);\n clipEditor -e \n -displayKeys 0\n -displayTangents 0\n -displayActiveKeys 0\n -displayActiveKeyTangents 0\n -displayInfinities 0\n -autoFit 0\n -snapTime \"none\" \n -snapValue \"none\" \n $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"hyperGraphPanel\" (localizedPanelLabel(\"Hypergraph Hierarchy\")) `;\n"
+ "\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"hyperGraphPanel\" -l (localizedPanelLabel(\"Hypergraph Hierarchy\")) -mbv $menusOkayInPanels `;\n\n\t\t\t$editorName = ($panelName+\"HyperGraphEd\");\n hyperGraph -e \n -graphLayoutStyle \"hierarchicalLayout\" \n -orientation \"horiz\" \n -zoom 1\n -animateTransition 0\n -showShapes 0\n -showDeformers 0\n -showExpressions 0\n -showConstraints 0\n -showUnderworld 0\n -showInvisible 0\n -transitionFrames 1\n -freeform 0\n -imagePosition 0 0 \n -imageScale 1\n -imageEnabled 0\n -graphType \"DAG\" \n -updateSelection 1\n -updateNodeAdded 1\n -useDrawOverrideColor 0\n -limitGraphTraversal -1\n -iconSize \"smallIcons\" \n -showCachedConnections 0\n"
+ " $editorName;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Hypergraph Hierarchy\")) -mbv $menusOkayInPanels $panelName;\n\n\t\t\t$editorName = ($panelName+\"HyperGraphEd\");\n hyperGraph -e \n -graphLayoutStyle \"hierarchicalLayout\" \n -orientation \"horiz\" \n -zoom 1\n -animateTransition 0\n -showShapes 0\n -showDeformers 0\n -showExpressions 0\n -showConstraints 0\n -showUnderworld 0\n -showInvisible 0\n -transitionFrames 1\n -freeform 0\n -imagePosition 0 0 \n -imageScale 1\n -imageEnabled 0\n -graphType \"DAG\" \n -updateSelection 1\n -updateNodeAdded 1\n -useDrawOverrideColor 0\n -limitGraphTraversal -1\n -iconSize \"smallIcons\" \n -showCachedConnections 0\n"
+ " $editorName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"hyperShadePanel\" (localizedPanelLabel(\"Hypershade\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"hyperShadePanel\" -l (localizedPanelLabel(\"Hypershade\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Hypershade\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"visorPanel\" (localizedPanelLabel(\"Visor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"visorPanel\" -l (localizedPanelLabel(\"Visor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Visor\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"polyTexturePlacementPanel\" (localizedPanelLabel(\"UV Texture Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"polyTexturePlacementPanel\" -l (localizedPanelLabel(\"UV Texture Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"UV Texture Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"multiListerPanel\" (localizedPanelLabel(\"Multilister\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"multiListerPanel\" -l (localizedPanelLabel(\"Multilister\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Multilister\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"renderWindowPanel\" (localizedPanelLabel(\"Render View\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"renderWindowPanel\" -l (localizedPanelLabel(\"Render View\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Render View\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"blendShapePanel\" (localizedPanelLabel(\"Blend Shape\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\tblendShapePanel -unParent -l (localizedPanelLabel(\"Blend Shape\")) -mbv $menusOkayInPanels ;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tblendShapePanel -edit -l (localizedPanelLabel(\"Blend Shape\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n"
+ "\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dynRelEdPanel\" (localizedPanelLabel(\"Dynamic Relationships\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"dynRelEdPanel\" -l (localizedPanelLabel(\"Dynamic Relationships\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Dynamic Relationships\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextPanel \"devicePanel\" (localizedPanelLabel(\"Devices\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\tdevicePanel -unParent -l (localizedPanelLabel(\"Devices\")) -mbv $menusOkayInPanels ;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tdevicePanel -edit -l (localizedPanelLabel(\"Devices\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n"
+ "\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"relationshipPanel\" (localizedPanelLabel(\"Relationship Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"relationshipPanel\" -l (localizedPanelLabel(\"Relationship Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Relationship Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"referenceEditorPanel\" (localizedPanelLabel(\"Reference Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"referenceEditorPanel\" -l (localizedPanelLabel(\"Reference Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Reference Editor\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"componentEditorPanel\" (localizedPanelLabel(\"Component Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"componentEditorPanel\" -l (localizedPanelLabel(\"Component Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Component Editor\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"dynPaintScriptedPanelType\" (localizedPanelLabel(\"Paint Effects\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"dynPaintScriptedPanelType\" -l (localizedPanelLabel(\"Paint Effects\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Paint Effects\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"webBrowserPanel\" (localizedPanelLabel(\"Web Browser\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"webBrowserPanel\" -l (localizedPanelLabel(\"Web Browser\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Web Browser\")) -mbv $menusOkayInPanels $panelName;\n\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\t$panelName = `sceneUIReplacement -getNextScriptedPanel \"scriptEditorPanel\" (localizedPanelLabel(\"Script Editor\")) `;\n\tif (\"\" == $panelName) {\n\t\tif ($useSceneConfig) {\n\t\t\t$panelName = `scriptedPanel -unParent -type \"scriptEditorPanel\" -l (localizedPanelLabel(\"Script Editor\")) -mbv $menusOkayInPanels `;\n\t\t}\n\t} else {\n\t\t$label = `panel -q -label $panelName`;\n\t\tscriptedPanel -edit -l (localizedPanelLabel(\"Script Editor\")) -mbv $menusOkayInPanels $panelName;\n"
+ "\t\tif (!$useSceneConfig) {\n\t\t\tpanel -e -l $label $panelName;\n\t\t}\n\t}\n\n\n\tif ($useSceneConfig) {\n string $configName = `getPanel -cwl (localizedPanelLabel(\"Current Layout\"))`;\n if (\"\" != $configName) {\n\t\t\tpanelConfiguration -edit -label (localizedPanelLabel(\"Current Layout\")) \n\t\t\t\t-defaultImage \"\"\n\t\t\t\t-image \"\"\n\t\t\t\t-sc false\n\t\t\t\t-configString \"global string $gMainPane; paneLayout -e -cn \\\"single\\\" -ps 1 100 100 $gMainPane;\"\n\t\t\t\t-removeAllPanels\n\t\t\t\t-ap false\n\t\t\t\t\t(localizedPanelLabel(\"Persp View\")) \n\t\t\t\t\t\"modelPanel\"\n"
+ "\t\t\t\t\t\"$panelName = `modelPanel -unParent -l (localizedPanelLabel(\\\"Persp View\\\")) -mbv $menusOkayInPanels `;\\n$editorName = $panelName;\\nmodelEditor -e \\n -cam `findStartUpCamera persp` \\n -useInteractiveMode 0\\n -displayLights \\\"default\\\" \\n -displayAppearance \\\"wireframe\\\" \\n -activeOnly 0\\n -wireframeOnShaded 0\\n -headsUpDisplay 1\\n -selectionHiliteDisplay 1\\n -useDefaultMaterial 0\\n -bufferMode \\\"double\\\" \\n -twoSidedLighting 1\\n -backfaceCulling 0\\n -xray 0\\n -displayTextures 0\\n -smoothWireframe 0\\n -textureAnisotropic 0\\n -textureHilight 1\\n -textureSampling 2\\n -textureDisplay \\\"modulate\\\" \\n -textureMaxSize 8192\\n -fogging 0\\n -fogSource \\\"fragment\\\" \\n -fogMode \\\"linear\\\" \\n -fogStart 0\\n -fogEnd 100\\n -fogDensity 0.1\\n -fogColor 0.5 0.5 0.5 1 \\n -maxConstantTransparency 1\\n -rendererName \\\"base_OpenGL_Renderer\\\" \\n -colorResolution 256 256 \\n -bumpResolution 512 512 \\n -textureCompression 0\\n -transparencyAlgorithm \\\"frontAndBackCull\\\" \\n -transpInShadows 0\\n -cullingOverride \\\"none\\\" \\n -lowQualityLighting 0\\n -maximumNumHardwareLights 1\\n -occlusionCulling 0\\n -useBaseRenderer 0\\n -useReducedRenderer 0\\n -smallObjectCulling 0\\n -smallObjectThreshold -1 \\n -interactiveDisableShadows 0\\n -interactiveBackFaceCull 0\\n -sortTransparent 1\\n -nurbsCurves 1\\n -nurbsSurfaces 1\\n -polymeshes 1\\n -subdivSurfaces 1\\n -planes 1\\n -lights 1\\n -cameras 1\\n -controlVertices 1\\n -hulls 1\\n -grid 1\\n -joints 1\\n -ikHandles 1\\n -deformers 1\\n -dynamics 1\\n -fluids 1\\n -hairSystems 1\\n -follicles 1\\n -nCloths 1\\n -nRigids 1\\n -dynamicConstraints 1\\n -locators 1\\n -manipulators 1\\n -dimensions 1\\n -handles 1\\n -pivots 1\\n -textures 1\\n -strokes 1\\n -shadows 0\\n $editorName;\\nmodelEditor -e -viewSelected 0 $editorName\"\n"
+ "\t\t\t\t\t\"modelPanel -edit -l (localizedPanelLabel(\\\"Persp View\\\")) -mbv $menusOkayInPanels $panelName;\\n$editorName = $panelName;\\nmodelEditor -e \\n -cam `findStartUpCamera persp` \\n -useInteractiveMode 0\\n -displayLights \\\"default\\\" \\n -displayAppearance \\\"wireframe\\\" \\n -activeOnly 0\\n -wireframeOnShaded 0\\n -headsUpDisplay 1\\n -selectionHiliteDisplay 1\\n -useDefaultMaterial 0\\n -bufferMode \\\"double\\\" \\n -twoSidedLighting 1\\n -backfaceCulling 0\\n -xray 0\\n -displayTextures 0\\n -smoothWireframe 0\\n -textureAnisotropic 0\\n -textureHilight 1\\n -textureSampling 2\\n -textureDisplay \\\"modulate\\\" \\n -textureMaxSize 8192\\n -fogging 0\\n -fogSource \\\"fragment\\\" \\n -fogMode \\\"linear\\\" \\n -fogStart 0\\n -fogEnd 100\\n -fogDensity 0.1\\n -fogColor 0.5 0.5 0.5 1 \\n -maxConstantTransparency 1\\n -rendererName \\\"base_OpenGL_Renderer\\\" \\n -colorResolution 256 256 \\n -bumpResolution 512 512 \\n -textureCompression 0\\n -transparencyAlgorithm \\\"frontAndBackCull\\\" \\n -transpInShadows 0\\n -cullingOverride \\\"none\\\" \\n -lowQualityLighting 0\\n -maximumNumHardwareLights 1\\n -occlusionCulling 0\\n -useBaseRenderer 0\\n -useReducedRenderer 0\\n -smallObjectCulling 0\\n -smallObjectThreshold -1 \\n -interactiveDisableShadows 0\\n -interactiveBackFaceCull 0\\n -sortTransparent 1\\n -nurbsCurves 1\\n -nurbsSurfaces 1\\n -polymeshes 1\\n -subdivSurfaces 1\\n -planes 1\\n -lights 1\\n -cameras 1\\n -controlVertices 1\\n -hulls 1\\n -grid 1\\n -joints 1\\n -ikHandles 1\\n -deformers 1\\n -dynamics 1\\n -fluids 1\\n -hairSystems 1\\n -follicles 1\\n -nCloths 1\\n -nRigids 1\\n -dynamicConstraints 1\\n -locators 1\\n -manipulators 1\\n -dimensions 1\\n -handles 1\\n -pivots 1\\n -textures 1\\n -strokes 1\\n -shadows 0\\n $editorName;\\nmodelEditor -e -viewSelected 0 $editorName\"\n"
+ "\t\t\t\t$configName;\n\n setNamedPanelLayout (localizedPanelLabel(\"Current Layout\"));\n }\n\n panelHistory -e -clear mainPanelHistory;\n setFocus `paneLayout -q -p1 $gMainPane`;\n sceneUIReplacement -deleteRemaining;\n sceneUIReplacement -clear;\n\t}\n\n\ngrid -spacing 5 -size 12 -divisions 5 -displayAxes yes -displayGridLines yes -displayDivisionLines yes -displayPerspectiveLabels no -displayOrthographicLabels no -displayAxesBold yes -perspectiveLabelPosition axis -orthographicLabelPosition edge;\n}\n");
setAttr ".st" 3;
createNode script -n "sceneConfigurationScriptNode";
setAttr ".b" -type "string" "playbackOptions -min 1 -max 100 -ast 1 -aet 100 ";
setAttr ".st" 6;
select -ne :time1;
setAttr ".o" 1;
select -ne :renderPartition;
setAttr -s 2 ".st";
select -ne :renderGlobalsList1;
select -ne :defaultShaderList1;
setAttr -s 2 ".s";
select -ne :postProcessList1;
setAttr -s 2 ".p";
select -ne :lightList1;
select -ne :initialShadingGroup;
setAttr ".ro" yes;
select -ne :initialParticleSE;
setAttr ".ro" yes;
select -ne :hardwareRenderGlobals;
setAttr ".ctrs" 256;
setAttr ".btrs" 512;
select -ne :defaultHardwareRenderGlobals;
setAttr ".fn" -type "string" "im";
setAttr ".res" -type "string" "ntsc_4d 646 485 1.333";
connectAttr "dSolver1.rbds" "dRigidBodyShape3.solv";
connectAttr "dCollisionShape3.oucs" "dRigidBodyShape3.incs";
connectAttr "dSolver1.rbds" "dRigidBodyShape4.solv";
connectAttr "dCollisionShape4.oucs" "dRigidBodyShape4.incs";
connectAttr "dSolver1.rbds" "dRigidBodyShape5.solv";
connectAttr "dCollisionShape5.oucs" "dRigidBodyShape5.incs";
connectAttr "dRigidBodyShape5.msg" "dSliderConstraintShape1.inrbA";
connectAttr "dRigidBodyShape4.msg" "dSliderConstraintShape1.inrbB";
connectAttr "dSolver1.rbds" "dRigidBodyShape6.solv";
connectAttr "dCollisionShape6.oucs" "dRigidBodyShape6.incs";
connectAttr ":defaultLightSet.msg" "lightLinker1.lnk[0].llnk";
connectAttr ":initialShadingGroup.msg" "lightLinker1.lnk[0].olnk";
connectAttr ":defaultLightSet.msg" "lightLinker1.lnk[1].llnk";
connectAttr ":initialParticleSE.msg" "lightLinker1.lnk[1].olnk";
connectAttr ":defaultLightSet.msg" "lightLinker1.slnk[0].sllk";
connectAttr ":initialShadingGroup.msg" "lightLinker1.slnk[0].solk";
connectAttr ":defaultLightSet.msg" "lightLinker1.slnk[1].sllk";
connectAttr ":initialParticleSE.msg" "lightLinker1.slnk[1].solk";
connectAttr "layerManager.dli[0]" "defaultLayer.id";
connectAttr "renderLayerManager.rlmi[0]" "defaultRenderLayer.rlid";
connectAttr ":time1.o" "dSolver1.it";
connectAttr "lightLinker1.msg" ":lightList1.ln" -na;
// End of SliderConstraint.ma

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//AEdHingeConstraintTemplate.mel //AEdHingeConstraintTemplate.mel
@@ -28,7 +31,8 @@ global proc AEdHingeConstraintTemplate( string $nodeName )
editorTemplate -beginScrollLayout; editorTemplate -beginScrollLayout;
editorTemplate -addControl damping; editorTemplate -addControl damping;
editorTemplate -addControl inRigidBody; editorTemplate -addControl inRigidBodyA;
editorTemplate -addControl inRigidBodyB;
editorTemplate -addControl lowerLimit; editorTemplate -addControl lowerLimit;
editorTemplate -addControl upperLimit; editorTemplate -addControl upperLimit;
@@ -38,7 +42,10 @@ global proc AEdHingeConstraintTemplate( string $nodeName )
separator; separator;
editorTemplate -addControl hingeAxis; editorTemplate -addControl rotationInA;
editorTemplate -addControl pivotInA;
editorTemplate -addControl rotationInB;
editorTemplate -addControl pivotInB;
editorTemplate -addControl enableAngularMotor; editorTemplate -addControl enableAngularMotor;
editorTemplate -addControl motorTargetVelocity; editorTemplate -addControl motorTargetVelocity;
editorTemplate -addControl maxMotorImpulse; editorTemplate -addControl maxMotorImpulse;

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//AEdNailConstraintTemplate.mel //AEdNailConstraintTemplate.mel
@@ -34,6 +33,8 @@ global proc AEdNailConstraintTemplate( string $nodeName )
editorTemplate -addControl damping; editorTemplate -addControl damping;
editorTemplate -addControl inRigidBodyA; editorTemplate -addControl inRigidBodyA;
editorTemplate -addControl inRigidBodyB; editorTemplate -addControl inRigidBodyB;
editorTemplate -addControl pivotInA;
editorTemplate -addControl pivotInB;
AEdependNodeTemplate $nodeName; AEdependNodeTemplate $nodeName;

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//AEdSixdofConstraintTemplate.mel //AEdSixdofConstraintTemplate.mel
@@ -35,6 +38,13 @@ global proc AEdSixdofConstraintTemplate( string $nodeName )
editorTemplate -addControl lowerAngLimit; editorTemplate -addControl lowerAngLimit;
editorTemplate -addControl upperAngLimit; editorTemplate -addControl upperAngLimit;
separator;
editorTemplate -addControl rotationInA;
editorTemplate -addControl pivotInA;
editorTemplate -addControl rotationInB;
editorTemplate -addControl pivotInB;
AEdependNodeTemplate $nodeName; AEdependNodeTemplate $nodeName;
editorTemplate -addExtraControls; editorTemplate -addExtraControls;

View File

@@ -18,6 +18,9 @@ not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
Written by: Herbert Law <Herbert.Law@gmail.com> Written by: Herbert Law <Herbert.Law@gmail.com>
Modified by Roman Ponomarev <rponom@gmail.com>
01/22/2010 : Constraints reworked
*/ */
//AEdSliderConstraintTemplate.mel //AEdSliderConstraintTemplate.mel
@@ -35,6 +38,13 @@ global proc AEdSliderConstraintTemplate( string $nodeName )
editorTemplate -addControl lowerAngLimit; editorTemplate -addControl lowerAngLimit;
editorTemplate -addControl upperAngLimit; editorTemplate -addControl upperAngLimit;
separator;
editorTemplate -addControl rotationInA;
editorTemplate -addControl pivotInA;
editorTemplate -addControl rotationInB;
editorTemplate -addControl pivotInB;
AEdependNodeTemplate $nodeName; AEdependNodeTemplate $nodeName;
editorTemplate -addExtraControls; editorTemplate -addExtraControls;

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//dynamicaUI.mel //dynamicaUI.mel
@@ -29,12 +28,17 @@ Modified by Roman Ponomarev <rponom@gmail.com>
// //
global string $dynamicaUIWindow = "dynamicaUIWindow"; global string $dynamicaUIWindow = "dynamicaUIWindow";
global proc dynamicaUI_initialize() global proc dynamicaUI_initialize()
{ {
dynamicaUI_createShelfButton(); dynamicaUI_createShelfButton();
//add script jobs //add script jobs
// scriptJob -e "SceneOpened" gpufxGUI_updateSettings; // scriptJob -e "SceneOpened" gpufxGUI_updateSettings;
// scriptJob -e "timeChanged" "dynamicaUI_timeChangedCallback";
// scriptJob -cc "playingBack" "dynamicaUI_playingBackCallback";
// expression -string "dynamicaUI_timeChangedCallback";
} }
//main window //main window
@@ -72,10 +76,9 @@ global proc dynamicaUI_createWindow()
showWindow $dynamicaUIWindow; showWindow $dynamicaUIWindow;
// window -e -wh 479 664 $dynamicaUIWindow; // window -e -wh 479 664 $dynamicaUIWindow;
} }
global proc dynamicaUI_createShelfButton() global proc dynamicaUI_createShelfButton()
{ {
// The shelf we want to add the button to. // The shelf we want to add the button to.
@@ -427,18 +430,27 @@ proc dynamicaUI_createRigidBody(int $activebody, int $collisionShapeType)
dSolver; dSolver;
string $newBodies[]; string $newBodies[];
int $makeCollisionShape;
//pick the selected object's transform only if we are creating a hull or a mesh //pick the selected object's transform only if we are creating a hull or a mesh
if($collisionShapeType == 0 || $collisionShapeType == 1) { if($collisionShapeType == 0 || $collisionShapeType == 1) {
for($i = 0; $i < size($selection) / 2; $i++) { for($i = 0; $i < size($selection) / 2; $i++)
{
$makeCollisionShape = 1;
string $connectedCollisionShapes[] = `listConnections -s true -t dCollisionShape $selection[$i * 2]`;
if(size($connectedCollisionShapes) > 0)
{
$makeCollisionShape = 0;
}
string $shapeTransforms[] = `listRelatives -parent $selection[$i * 2]`;
if($makeCollisionShape)
{
string $rigidBodyNode = `dRigidBody`; string $rigidBodyNode = `dRigidBody`;
string $collisionShapeNode = `createNode dCollisionShape`; string $collisionShapeNode = `createNode dCollisionShape`;
connectAttr ($collisionShapeNode + ".outCollisionShape") ($rigidBodyNode + ".inCollisionShape"); connectAttr ($collisionShapeNode + ".outCollisionShape") ($rigidBodyNode + ".inCollisionShape");
string $rigidBodyTransforms[] = `listRelatives -parent $rigidBodyNode`; string $rigidBodyTransforms[] = `listRelatives -parent $rigidBodyNode`;
string $shapeTransforms[] = `listRelatives -parent $selection[$i * 2]`;
if($selection[$i * 2 + 1] == "mesh") { if($selection[$i * 2 + 1] == "mesh") {
connectAttr ($selection[$i * 2] + ".message") ($collisionShapeNode + ".inShape"); connectAttr ($selection[$i * 2] + ".message") ($collisionShapeNode + ".inShape");
hide $shapeTransforms[0]; hide $shapeTransforms[0];
@@ -450,13 +462,19 @@ proc dynamicaUI_createRigidBody(int $activebody, int $collisionShapeType)
float $rot[]= `getAttr ($shapeTransforms[0] + ".rotate")`; float $rot[]= `getAttr ($shapeTransforms[0] + ".rotate")`;
setAttr ($rigidBodyTransforms[0] + ".translate") -type double3 $pos[0] $pos[1] $pos[2]; setAttr ($rigidBodyTransforms[0] + ".translate") -type double3 $pos[0] $pos[1] $pos[2];
//setAttr ($rigidBodyNode + ".initialPosition") -type double3 $pos[0] $pos[1] $pos[2]; setAttr ($rigidBodyNode + ".initialPosition") -type double3 $pos[0] $pos[1] $pos[2];
setAttr ($rigidBodyTransforms[0] + ".rotate") -type double3 $rot[0] $rot[1] $rot[2]; setAttr ($rigidBodyTransforms[0] + ".rotate") -type double3 $rot[0] $rot[1] $rot[2];
// setAttr ($rigidBodyNode + ".initialRotation") -type double3 $rot[0] $rot[1] $rot[2]; setAttr ($rigidBodyNode + ".initialRotation") -type double3 $rot[0] $rot[1] $rot[2];
$newBodies[$i] = $rigidBodyTransforms[0]; $newBodies[$i] = $rigidBodyTransforms[0];
} }
else
{
print("Warning : Object " + $shapeTransforms[0] + " already is a rigid body\n");
$newBodies[$i] = $shapeTransforms[0];
}
}
} else { } else {
string $rigidBodyNode = `dRigidBody`; string $rigidBodyNode = `dRigidBody`;
string $collisionShapeNode = `createNode dCollisionShape`; string $collisionShapeNode = `createNode dCollisionShape`;
@@ -689,6 +707,33 @@ global proc dynamicaUI_createPassiveMeshRBArray()
dynamicaUI_createRigidBodyArray(false, 1); dynamicaUI_createRigidBodyArray(false, 1);
} }
global proc float[] dynamicaUI_worldToObj(float $pointW[], float $objToWorldMatrix[])
{
float $result[];
$result[0] = 0.0;
$result[1] = 0.0;
$result[2] = 0.0;
float $offs[];
if ( size($pointW) != 3 || size($objToWorldMatrix) != 16 )
{
warning("Point must be an array of 3 doubles and matrix must be an array of 16 doubles.");
return $result;
}
for($i = 0; $i < 3; $i++)
{
$offs[$i] = $pointW[$i] - $objToWorldMatrix[12 + $i];
}
for($i = 0; $i < 3; $i++)
{
for($j = 0; $j < 3; $j++)
{
$result[$i] += $objToWorldMatrix[$i * 4 + $j] * $offs[$j];
}
}
return $result;
}
global proc dynamicaUI_createNailConstraint() global proc dynamicaUI_createNailConstraint()
{ {
string $selection[] = `ls -selection -dag -leaf -showType -type "geometry"`; string $selection[] = `ls -selection -dag -leaf -showType -type "geometry"`;
@@ -711,87 +756,208 @@ global proc dynamicaUI_createNailConstraint()
} }
// create nail constraint node // create nail constraint node
string $constraintNode = `dNailConstraint`; string $constraintNode = `dNailConstraint`;
string $constraintTransforms[] = `listRelatives -parent $constraintNode`;
string $newConstraintTransf = $constraintTransforms[0];
// connect to bodies // connect to bodies
if($selSize == 2) if($selSize == 2)
{ {
connectAttr ($selection[0] + ".message") ($constraintNode + ".inRigidBodyA"); connectAttr ($selection[0] + ".message") ($constraintNode + ".inRigidBodyA");
string $rbTransform[] = `listRelatives -parent $selection[0]`;
float $posA[3] = `getAttr ($rbTransform[0] + ".translate")`;
float $iWorldA[16] = `getAttr ($rbTransform[0] + ".worldMatrix")`;
float $pivA[] = dynamicaUI_worldToObj($posA, $iWorldA);
setAttr ($constraintNode + ".pivotInA") -type float3 $pivA[0] $pivA[1] $pivA[2];
setAttr ($newConstraintTransf + ".translate") -type float3 $posA[0] $posA[1] $posA[2];
} }
else else
{ {
connectAttr ($selection[0] + ".message") ($constraintNode + ".inRigidBodyA"); connectAttr ($selection[0] + ".message") ($constraintNode + ".inRigidBodyA");
connectAttr ($selection[2] + ".message") ($constraintNode + ".inRigidBodyB"); connectAttr ($selection[2] + ".message") ($constraintNode + ".inRigidBodyB");
string $rbTransformA[] = `listRelatives -parent $selection[0]`;
string $rbTransformB[] = `listRelatives -parent $selection[2]`;
float $posA[] = `getAttr ($rbTransformA[0] + ".translate")`;
float $posB[] = `getAttr ($rbTransformB[2] + ".translate")`;
float $pivW[3];
for($k=0; $k < 3; $k++) $pivW[$k] = $posA[$k];
float $iWorldA[16] = `getAttr ($rbTransformA[0] + ".worldMatrix")`;
float $iWorldB[16] = `getAttr ($rbTransformB[0] + ".worldMatrix")`;
float $pivA[] = dynamicaUI_worldToObj($pivW, $iWorldA);
float $pivB[] = dynamicaUI_worldToObj($pivW, $iWorldB);
setAttr ($constraintNode + ".pivotInA") -type float3 $pivA[0] $pivA[1] $pivA[2];
setAttr ($constraintNode + ".pivotInB") -type float3 $pivB[0] $pivB[1] $pivB[2];
setAttr ($newConstraintTransf + ".translate") -type float3 $pivW[0] $pivW[1] $pivW[2];
} }
string $constraintTransforms[] = `listRelatives -parent $constraintNode`; select -r $newConstraintTransf;
string $newConstraint = $constraintTransforms[0];
select -r $newConstraint;
} }
global proc dynamicaUI_createHingeConstraint() global proc dynamicaUI_createHingeConstraint()
{ {
string $selection[] = `ls -selection -dag -leaf -showType -type "geometry"`; string $selection[] = `ls -selection -dag -leaf -showType -type "geometry"`;
//create dSolver node if necessary //create dSolver node if necessary
dSolver; dSolver;
// check selection in scene : one or two rigidBodies should be selected
string $newConstraints[]; int $selSize = size($selection);
for($i = 0; $i < size($selection) / 2; $i++) { int $selOK = (($selSize == 2) || ($selSize == 4));
if($selection[$i * 2 + 1] == "dRigidBody") { for($i = 0; $i < $selSize/2; $i++)
{
if($selection[$i * 2 + 1] != "dRigidBody")
{
$selOK = 0;
}
}
if(!$selOK)
{
error("Select one or two bodies to create a hinge constraint");
return;
}
// create hinge constraint node
string $constraintNode = `dHingeConstraint`; string $constraintNode = `dHingeConstraint`;
connectAttr ($selection[$i * 2] + ".message") ($constraintNode + ".inRigidBody");
string $constraintTransforms[] = `listRelatives -parent $constraintNode`; string $constraintTransforms[] = `listRelatives -parent $constraintNode`;
$newConstraints[$i] = $constraintTransforms[0]; string $newConstraintTransf = $constraintTransforms[0];
// connect to bodies
if($selSize == 2)
{
connectAttr ($selection[0] + ".message") ($constraintNode + ".inRigidBodyA");
string $rbTransform[] = `listRelatives -parent $selection[0]`;
float $posA[3] = `getAttr ($rbTransform[0] + ".translate")`;
float $iWorldA[16] = `getAttr ($rbTransform[0] + ".worldMatrix")`;
float $pivA[] = dynamicaUI_worldToObj($posA, $iWorldA);
setAttr ($constraintNode + ".pivotInA") -type float3 $pivA[0] $pivA[1] $pivA[2];
setAttr ($newConstraintTransf + ".translate") -type float3 $posA[0] $posA[1] $posA[2];
} }
else
{
connectAttr ($selection[0] + ".message") ($constraintNode + ".inRigidBodyA");
connectAttr ($selection[2] + ".message") ($constraintNode + ".inRigidBodyB");
string $rbTransformA[] = `listRelatives -parent $selection[0]`;
string $rbTransformB[] = `listRelatives -parent $selection[2]`;
float $posA[] = `getAttr ($rbTransformA[0] + ".translate")`;
float $posB[] = `getAttr ($rbTransformB[2] + ".translate")`;
float $pivW[3];
for($k=0; $k < 3; $k++) $pivW[$k] = $posA[$k];
float $iWorldA[16] = `getAttr ($rbTransformA[0] + ".worldMatrix")`;
float $iWorldB[16] = `getAttr ($rbTransformB[0] + ".worldMatrix")`;
float $pivA[] = dynamicaUI_worldToObj($pivW, $iWorldA);
float $pivB[] = dynamicaUI_worldToObj($pivW, $iWorldB);
setAttr ($constraintNode + ".pivotInA") -type float3 $pivA[0] $pivA[1] $pivA[2];
setAttr ($constraintNode + ".pivotInB") -type float3 $pivB[0] $pivB[1] $pivB[2];
setAttr ($newConstraintTransf + ".translate") -type float3 $pivW[0] $pivW[1] $pivW[2];
} }
select -r $newConstraints; select -r $newConstraintTransf;
} }
global proc dynamicaUI_createSliderConstraint() global proc dynamicaUI_createSliderConstraint()
{ {
string $selection[] = `ls -selection -dag -leaf -showType -type "geometry"`; string $selection[] = `ls -selection -dag -leaf -showType -type "geometry"`;
//create dSolver node if necessary //create dSolver node if necessary
dSolver; dSolver;
// check selection in scene : one or two rigidBodies should be selected
string $newConstraints[]; int $selSize = size($selection);
if (size($selection) < 4) int $selOK = (($selSize == 2) || ($selSize == 4));
print("Requres 2 Rigid Body to create a Slider"); for($i = 0; $i < $selSize/2; $i++)
for($i = 0; $i < size($selection) / 4; $i++) {
if($selection[$i * 2 + 1] == "dRigidBody" && $selection[$i * 2 + 3] == "dRigidBody") {
string $constraintNode = `dSliderConstraint`;
connectAttr ($selection[$i * 2] + ".message") ($constraintNode + ".inRigidBodyA");
connectAttr ($selection[$i * 2 + 2] + ".message") ($constraintNode + ".inRigidBodyB");
string $constraintTransforms[] = `listRelatives -parent $constraintNode`;
$newConstraints[$i] = $constraintTransforms[0];
select -r $newConstraints;
} else
{ {
print("Requres 2 Rigid Body to create a slider constraint"); if($selection[$i * 2 + 1] != "dRigidBody")
{
$selOK = 0;
} }
} }
if(!$selOK)
{
error("Select one or two bodies to create a slider constraint");
return;
} }
// create slider constraint node
string $constraintNode = `dSliderConstraint`;
string $constraintTransforms[] = `listRelatives -parent $constraintNode`;
string $newConstraintTransf = $constraintTransforms[0];
// connect to bodies
if($selSize == 2)
{
connectAttr ($selection[0] + ".message") ($constraintNode + ".inRigidBodyA");
string $rbTransform[] = `listRelatives -parent $selection[0]`;
float $posA[3] = `getAttr ($rbTransform[0] + ".translate")`;
float $iWorldA[16] = `getAttr ($rbTransform[0] + ".worldMatrix")`;
float $pivA[] = dynamicaUI_worldToObj($posA, $iWorldA);
setAttr ($constraintNode + ".pivotInA") -type float3 $pivA[0] $pivA[1] $pivA[2];
setAttr ($newConstraintTransf + ".translate") -type float3 $posA[0] $posA[1] $posA[2];
}
else
{
connectAttr ($selection[0] + ".message") ($constraintNode + ".inRigidBodyA");
connectAttr ($selection[2] + ".message") ($constraintNode + ".inRigidBodyB");
string $rbTransformA[] = `listRelatives -parent $selection[0]`;
string $rbTransformB[] = `listRelatives -parent $selection[2]`;
float $posA[] = `getAttr ($rbTransformA[0] + ".translate")`;
float $posB[] = `getAttr ($rbTransformB[2] + ".translate")`;
float $pivW[3];
for($k=0; $k < 3; $k++) $pivW[$k] = $posA[$k];
float $iWorldA[16] = `getAttr ($rbTransformA[0] + ".worldMatrix")`;
float $iWorldB[16] = `getAttr ($rbTransformB[0] + ".worldMatrix")`;
float $pivA[] = dynamicaUI_worldToObj($pivW, $iWorldA);
float $pivB[] = dynamicaUI_worldToObj($pivW, $iWorldB);
setAttr ($constraintNode + ".pivotInA") -type float3 $pivA[0] $pivA[1] $pivA[2];
setAttr ($constraintNode + ".pivotInB") -type float3 $pivB[0] $pivB[1] $pivB[2];
setAttr ($newConstraintTransf + ".translate") -type float3 $pivW[0] $pivW[1] $pivW[2];
}
select -r $newConstraintTransf;
}
global proc dynamicaUI_create6DofConstraint() global proc dynamicaUI_create6DofConstraint()
{ {
string $selection[] = `ls -selection -dag -leaf -showType -type "geometry"`; string $selection[] = `ls -selection -dag -leaf -showType -type "geometry"`;
//create dSolver node if necessary //create dSolver node if necessary
dSolver; dSolver;
// check selection in scene : one or two rigidBodies should be selected
string $newConstraints[]; int $selSize = size($selection);
if (size($selection) < 4) int $selOK = (($selSize == 2) || ($selSize == 4));
print("Requres 2 Rigid Body to create a 6Dof constraint"); for($i = 0; $i < $selSize/2; $i++)
for($i = 0; $i < size($selection) / 4; $i++) {
if($selection[$i * 2 + 1] == "dRigidBody" && $selection[$i * 2 + 3] == "dRigidBody") {
string $constraintNode = `dSixdofConstraint`;
connectAttr ($selection[$i * 2] + ".message") ($constraintNode + ".inRigidBodyA");
connectAttr ($selection[$i * 2 + 2] + ".message") ($constraintNode + ".inRigidBodyB");
string $constraintTransforms[] = `listRelatives -parent $constraintNode`;
$newConstraints[$i] = $constraintTransforms[0];
select -r $newConstraints;
} else
{ {
print("Requres 2 Rigid Body to create a 6Dof constraint"); if($selection[$i * 2 + 1] != "dRigidBody")
{
$selOK = 0;
} }
} }
if(!$selOK)
{
error("Select one or two bodies to create a slider constraint");
return;
} }
// create slider constraint node
string $constraintNode = `dSixdofConstraint`;
string $constraintTransforms[] = `listRelatives -parent $constraintNode`;
string $newConstraintTransf = $constraintTransforms[0];
// connect to bodies
if($selSize == 2)
{
connectAttr ($selection[0] + ".message") ($constraintNode + ".inRigidBodyA");
string $rbTransform[] = `listRelatives -parent $selection[0]`;
float $posA[3] = `getAttr ($rbTransform[0] + ".translate")`;
float $iWorldA[16] = `getAttr ($rbTransform[0] + ".worldMatrix")`;
float $pivA[] = dynamicaUI_worldToObj($posA, $iWorldA);
setAttr ($constraintNode + ".pivotInA") -type float3 $pivA[0] $pivA[1] $pivA[2];
setAttr ($newConstraintTransf + ".translate") -type float3 $posA[0] $posA[1] $posA[2];
}
else
{
connectAttr ($selection[0] + ".message") ($constraintNode + ".inRigidBodyA");
connectAttr ($selection[2] + ".message") ($constraintNode + ".inRigidBodyB");
string $rbTransformA[] = `listRelatives -parent $selection[0]`;
string $rbTransformB[] = `listRelatives -parent $selection[2]`;
float $posA[] = `getAttr ($rbTransformA[0] + ".translate")`;
float $posB[] = `getAttr ($rbTransformB[2] + ".translate")`;
float $pivW[3];
for($k=0; $k < 3; $k++) $pivW[$k] = $posA[$k];
float $iWorldA[16] = `getAttr ($rbTransformA[0] + ".worldMatrix")`;
float $iWorldB[16] = `getAttr ($rbTransformB[0] + ".worldMatrix")`;
float $pivA[] = dynamicaUI_worldToObj($pivW, $iWorldA);
float $pivB[] = dynamicaUI_worldToObj($pivW, $iWorldB);
setAttr ($constraintNode + ".pivotInA") -type float3 $pivA[0] $pivA[1] $pivA[2];
setAttr ($constraintNode + ".pivotInB") -type float3 $pivB[0] $pivB[1] $pivB[2];
setAttr ($newConstraintTransf + ".translate") -type float3 $pivW[0] $pivW[1] $pivW[2];
}
select -r $newConstraintTransf;
}
global proc dyn_demo1() global proc dyn_demo1()
{ {

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//solver.cpp //solver.cpp
@@ -93,21 +92,33 @@ nail_constraint_t::pointer solver_t::create_nail_constraint(rigid_body_t::point
{ {
return nail_constraint_t::pointer(new nail_constraint_t(m_impl->create_nail_constraint(rb->impl(), pivot), rb)); return nail_constraint_t::pointer(new nail_constraint_t(m_impl->create_nail_constraint(rb->impl(), pivot), rb));
} }
nail_constraint_t::pointer solver_t::create_nail_constraint(rigid_body_t::pointer& rbA, rigid_body_t::pointer& rbB, vec3f const& pivot) nail_constraint_t::pointer solver_t::create_nail_constraint(rigid_body_t::pointer& rbA, rigid_body_t::pointer& rbB, vec3f const& pivotInA, vec3f const& pivotInB)
{ {
return nail_constraint_t::pointer(new nail_constraint_t(m_impl->create_nail_constraint(rbA->impl(), rbB->impl(), pivot), rbA, rbB)); return nail_constraint_t::pointer(new nail_constraint_t(m_impl->create_nail_constraint(rbA->impl(), rbB->impl(), pivotInA, pivotInB), rbA, rbB));
} }
hinge_constraint_t::pointer solver_t::create_hinge_constraint(rigid_body_t::pointer& rb, vec3f const& pivot) hinge_constraint_t::pointer solver_t::create_hinge_constraint(rigid_body_t::pointer& rb, vec3f const& pivot, quatf const& rot)
{ {
return hinge_constraint_t::pointer(new hinge_constraint_t(m_impl->create_hinge_constraint(rb->impl(), pivot), rb)); return hinge_constraint_t::pointer(new hinge_constraint_t(m_impl->create_hinge_constraint(rb->impl(), pivot, rot), rb));
} }
slider_constraint_t::pointer solver_t::create_slider_constraint(rigid_body_t::pointer& rbA, vec3f const& pivotA, rigid_body_t::pointer& rbB, vec3f const& pivotB) hinge_constraint_t::pointer solver_t::create_hinge_constraint(rigid_body_t::pointer& rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_t::pointer& rbB, vec3f const& pivotB, quatf const& rotB)
{ {
return slider_constraint_t::pointer(new slider_constraint_t(m_impl->create_slider_constraint(rbA->impl(), pivotA, rbB->impl(), pivotB), rbA, rbB)); return hinge_constraint_t::pointer(new hinge_constraint_t(m_impl->create_hinge_constraint(rbA->impl(), pivotA, rotA, rbB->impl(), pivotB, rotB), rbA, rbB));
} }
sixdof_constraint_t::pointer solver_t::create_sixdof_constraint(rigid_body_t::pointer& rbA, vec3f const& pivotA, rigid_body_t::pointer& rbB, vec3f const& pivotB) slider_constraint_t::pointer solver_t::create_slider_constraint(rigid_body_t::pointer& rb, vec3f const& pivot, quatf const& rot)
{ {
return sixdof_constraint_t::pointer(new sixdof_constraint_t(m_impl->create_sixdof_constraint(rbA->impl(), pivotA, rbB->impl(), pivotB), rbA, rbB)); return slider_constraint_t::pointer(new slider_constraint_t(m_impl->create_slider_constraint(rb->impl(), pivot, rot), rb));
}
slider_constraint_t::pointer solver_t::create_slider_constraint(rigid_body_t::pointer& rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_t::pointer& rbB, vec3f const& pivotB, quatf const& rotB)
{
return slider_constraint_t::pointer(new slider_constraint_t(m_impl->create_slider_constraint(rbA->impl(), pivotA, rotA, rbB->impl(), pivotB, rotB), rbA, rbB));
}
sixdof_constraint_t::pointer solver_t::create_sixdof_constraint(rigid_body_t::pointer& rb, vec3f const& pivot, quatf const& rot)
{
return sixdof_constraint_t::pointer(new sixdof_constraint_t(m_impl->create_sixdof_constraint(rb->impl(), pivot, rot), rb));
}
sixdof_constraint_t::pointer solver_t::create_sixdof_constraint(rigid_body_t::pointer& rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_t::pointer& rbB, vec3f const& pivotB, quatf const& rotB)
{
return sixdof_constraint_t::pointer(new sixdof_constraint_t(m_impl->create_sixdof_constraint(rbA->impl(), pivotA, rotA, rbB->impl(), pivotB, rotB), rbA, rbB));
} }
//add/remove from world //add/remove from world

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//solver.h //solver.h
@@ -72,11 +71,14 @@ public:
static rigid_body_t::pointer create_rigid_body(collision_shape_t::pointer& cs); static rigid_body_t::pointer create_rigid_body(collision_shape_t::pointer& cs);
static nail_constraint_t::pointer create_nail_constraint(rigid_body_t::pointer& rb, vec3f const& pivot = vec3f(0, 0, 0)); static nail_constraint_t::pointer create_nail_constraint(rigid_body_t::pointer& rb, vec3f const& pivot);
static nail_constraint_t::pointer create_nail_constraint(rigid_body_t::pointer& rbA, rigid_body_t::pointer& rbB, vec3f const& pivot = vec3f(0, 0, 0)); static nail_constraint_t::pointer create_nail_constraint(rigid_body_t::pointer& rbA, rigid_body_t::pointer& rbB, vec3f const& pivotInA, vec3f const& pivotInB);
static hinge_constraint_t::pointer create_hinge_constraint(rigid_body_t::pointer& rb, vec3f const& pivot = vec3f(0, 0, 0)); static hinge_constraint_t::pointer create_hinge_constraint(rigid_body_t::pointer& rb, vec3f const& pivot, quatf const& rot);
static slider_constraint_t::pointer create_slider_constraint(rigid_body_t::pointer& rbA, vec3f const& pivotA, rigid_body_t::pointer& rbB, vec3f const& pivotB = vec3f(0, 0, 0)); static hinge_constraint_t::pointer create_hinge_constraint(rigid_body_t::pointer& rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_t::pointer& rbB, vec3f const& pivotB, quatf const& rotB);
static sixdof_constraint_t::pointer create_sixdof_constraint(rigid_body_t::pointer& rbA, vec3f const& pivotA, rigid_body_t::pointer& rbB, vec3f const& pivotB = vec3f(0, 0, 0)); static slider_constraint_t::pointer create_slider_constraint(rigid_body_t::pointer& rb, vec3f const& pivot, quatf const& rot);
static slider_constraint_t::pointer create_slider_constraint(rigid_body_t::pointer& rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_t::pointer& rbB, vec3f const& pivotB, quatf const& rotB);
static sixdof_constraint_t::pointer create_sixdof_constraint(rigid_body_t::pointer& rb, vec3f const& pivot, quatf const& rot);
static sixdof_constraint_t::pointer create_sixdof_constraint(rigid_body_t::pointer& rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_t::pointer& rbB, vec3f const& pivotB, quatf const& rotB);
//add/remove from world //add/remove from world
static void add_rigid_body(rigid_body_t::pointer& rb); static void add_rigid_body(rigid_body_t::pointer& rb);

View File

@@ -20,8 +20,7 @@ not be misrepresented as being the original software.
Written by: Nicola Candussi <nicola@fluidinteractive.com> Written by: Nicola Candussi <nicola@fluidinteractive.com>
Modified by Roman Ponomarev <rponom@gmail.com> Modified by Roman Ponomarev <rponom@gmail.com>
12/24/2009 : Nail constraint improvements 01/22/2010 : Constraints reworked
*/ */
//solver_impl.h //solver_impl.h
@@ -57,10 +56,13 @@ public:
virtual rigid_body_impl_t* create_rigid_body(collision_shape_impl_t* cs) = 0; virtual rigid_body_impl_t* create_rigid_body(collision_shape_impl_t* cs) = 0;
virtual nail_constraint_impl_t* create_nail_constraint(rigid_body_impl_t* rb, vec3f const& pivot) = 0; virtual nail_constraint_impl_t* create_nail_constraint(rigid_body_impl_t* rb, vec3f const& pivot) = 0;
virtual nail_constraint_impl_t* create_nail_constraint(rigid_body_impl_t* rbA, rigid_body_impl_t* rbB, vec3f const& pivot) = 0; virtual nail_constraint_impl_t* create_nail_constraint(rigid_body_impl_t* rbA, rigid_body_impl_t* rbB, vec3f const& pivotInA, vec3f const& pivotInB) = 0;
virtual hinge_constraint_impl_t* create_hinge_constraint(rigid_body_impl_t* rb, vec3f const& pivot) = 0; virtual hinge_constraint_impl_t* create_hinge_constraint(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot) = 0;
virtual slider_constraint_impl_t* create_slider_constraint(rigid_body_impl_t* rbA, vec3f const& pivotA, rigid_body_impl_t* rbB, vec3f const& pivotB) = 0; virtual hinge_constraint_impl_t* create_hinge_constraint(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB) = 0;
virtual sixdof_constraint_impl_t* create_sixdof_constraint(rigid_body_impl_t* rbA, vec3f const& pivotA, rigid_body_impl_t* rbB, vec3f const& pivotB) = 0; virtual slider_constraint_impl_t* create_slider_constraint(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot) = 0;
virtual slider_constraint_impl_t* create_slider_constraint(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB) = 0;
virtual sixdof_constraint_impl_t* create_sixdof_constraint(rigid_body_impl_t* rb, vec3f const& pivot, quatf const& rot) = 0;
virtual sixdof_constraint_impl_t* create_sixdof_constraint(rigid_body_impl_t* rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_impl_t* rbB, vec3f const& pivotB, quatf const& rotB) = 0;
virtual void add_rigid_body(rigid_body_impl_t* rb) = 0; virtual void add_rigid_body(rigid_body_impl_t* rb) = 0;

View File

@@ -53,6 +53,19 @@ m_useSolveConstraintObsolete(D6_USE_OBSOLETE_METHOD)
} }
static btRigidBody s_fixed(0, 0, 0);
btGeneric6DofConstraint::btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB)
: btTypedConstraint(D6_CONSTRAINT_TYPE, s_fixed, rbB),
m_useSolveConstraintObsolete(false),
m_frameInB(frameInB),
m_useLinearReferenceFrameA(useLinearReferenceFrameB)
{
///not providing rigidbody A means implicitly using worldspace for body A
m_frameInA = rbB.getCenterOfMassTransform() * m_frameInB;
}
#define GENERIC_D6_DISABLE_WARMSTARTING 1 #define GENERIC_D6_DISABLE_WARMSTARTING 1

View File

@@ -323,7 +323,7 @@ public:
bool m_useSolveConstraintObsolete; bool m_useSolveConstraintObsolete;
btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA); btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB);
btGeneric6DofConstraint(); btGeneric6DofConstraint();
//! Calcs global transform of the offsets //! Calcs global transform of the offsets

View File

@@ -96,7 +96,8 @@ btSliderConstraint::btSliderConstraint(btRigidBody& rbB, const btTransform& fram
m_frameInB(frameInB), m_frameInB(frameInB),
m_useLinearReferenceFrameA(useLinearReferenceFrameB) m_useLinearReferenceFrameA(useLinearReferenceFrameB)
{ {
///not providing rigidbody B means implicitly using worldspace for body B ///not providing rigidbody A means implicitly using worldspace for body A
m_frameInA = rbB.getCenterOfMassTransform() * m_frameInB;
// m_frameInA.getOrigin() = m_rbA.getCenterOfMassTransform()(m_frameInA.getOrigin()); // m_frameInA.getOrigin() = m_rbA.getCenterOfMassTransform()(m_frameInA.getOrigin());
initParams(); initParams();