Ejemplo n.º 1
0
        // Utility for getting the related rock matrix pointer
        public rockingTransformCheckMatrix getRockingTransformMatrix()
        {
            //This make sure the correct downcast.
            rockingTransformCheckMatrix ret = new rockingTransformCheckMatrix(baseTransformationMatrix);

            baseTransformationMatrix.Dispose();
            baseTransformationMatrix = ret;
            return(ret);
        }
Ejemplo n.º 2
0
        public override void postConstructor()
        {
            //	Make sure the parent takes care of anything it needs.
            //
            base.postConstructor();

            //  The baseTransformationMatrix pointer should be setup properly
            //	at this point, but just in case, set the value if it is missing.
            //
            if (null == baseTransformationMatrix)
            {
                MGlobal.displayWarning("NULL baseTransformationMatrix found!");
                baseTransformationMatrix = new rockingTransformCheckMatrix();
            }

            MPlug aRockInXPlug = new MPlug(thisMObject(), aRockInX);
        }
Ejemplo n.º 3
0
        public override void validateAndSetValue(MPlug plug, MDataHandle handle, MDGContext context)
        {
            //	Make sure that there is something interesting to process.
            //
            if (plug.isNull)
            {
                throw new ArgumentNullException("plug");
            }

            if (plug.equalEqual(aRockInX))
            {
                MDataBlock  block       = _forceCache(context);
                MDataHandle blockHandle = block.outputValue(plug);

                // Update our new rock in x value
                double rockInX = handle.asDouble;
                blockHandle.set(rockInX);
                rockXValue = rockInX;

                // Update the custom transformation matrix to the
                // right rock value.
                rockingTransformCheckMatrix ltm = getRockingTransformMatrix();
                if (ltm != null)
                {
                    ltm.setRockInX(rockXValue);
                }
                else
                {
                    MGlobal.displayError("Failed to get rock transform matrix");
                }

                blockHandle.setClean();

                // Mark the matrix as dirty so that DG information
                // will update.
                dirtyMatrix();

                return;
            }
            base.validateAndSetValue(plug, handle, context);
        }
        public override void postConstructor()
        {
            //	Make sure the parent takes care of anything it needs.
            //
            base.postConstructor();

            // 	The baseTransformationMatrix pointer should be setup properly
            //	at this point, but just in case, set the value if it is missing.
            //
            if (null == baseTransformationMatrix)
            {
                MGlobal.displayWarning("NULL baseTransformationMatrix found!");
                baseTransformationMatrix = new rockingTransformCheckMatrix();
            }

            MPlug aRockInXPlug = new MPlug(thisMObject(), aRockInX);
        }
 // Utility for getting the related rock matrix pointer
 public rockingTransformCheckMatrix getRockingTransformMatrix()
 {
     //This make sure the correct downcast.
     rockingTransformCheckMatrix ret = new rockingTransformCheckMatrix(baseTransformationMatrix);
     baseTransformationMatrix.Dispose();
     baseTransformationMatrix = ret;
     return ret;
 }