Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Subject: Cameras
Subject: scaleDown command
Subject: black out solved
Subject: Aircraft Tutorial
Subject: Mathematical XYZ ?
Subject: Re: Its done This vs That
Subject: Re: Its done first week
recommendations for screen video captures?
Subject: 3DExplorer "Oddity "
Subject: Re: New Director
Subject: ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
Subject: RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Subject: Re: Texturing
Big Break Contest Videos
Subject: New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Subject: Plasma?
Looking for Inspiration
Subject: Weird EMail Q
Subject: Re: It 's done first week ?
Subject: Cherry not cranberry
Subject: Re: New game
Camera Animation Problem
Subject: Particle plugins?
 
How to get an value from 2 frames before the current frame using API!

How to get an value from 2 frames before the current frame using API!

2003-12-16       - By Erick Miller

 Back
Reply:     1     2     3  

Use the MDGContext class with MPlug. Here is an example of using it with
MPlug::getValue() to get the value of an internal attribute on a node
back into an MObject (the attribute is in an MObject called
inputMeshAttribute) , this example would work for an attribute of
MFnData::kMesh (polygon mesh) which is a more complex example, but would
work just the same for simple numeric attributes and multis or compounds
just as well, using all the similar MPlug member functions :

   double frameLagDbl = 2.0;
   MTime timer = MAnimControl::currentTime();
   double nowTime = timer.value();
   double lagTime = nowTime - frameLagDbl;
   timer.setValue( lagTime );
   MDGContext timeContext( timer );
   MObject thisNode = thisMObject();
   MPlug inputGeometryPlug( thisNode, inputMeshAttribute );

   MObject laggedInputGeomObj;
   inputGeometryPlug.getValue( laggedInputGeomObj, timeContext );

Cheers,
Erick

hradec.com wrote:

>I need to get an attribute value using MDataBlock.inputValue() from
>inside my compute function, but I need to get that value from 2 frames
>before the current frame. Just like getAttr -t option, but for
>MDataBlock.inputValue()!
>How can I do that? Can I use MGlobal::viewFrame()? Or theres another way
>to do that?
>[]'s Hradec
>hradec@(protected)
>www.hradec.com/hradec
>
--
Erick Miller     Technical Director                  emiller@(protected)
Digital Domain,  300 Rose Ave, Venice, CA 90291      (310)314-2800 ext.3504
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __





-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---
List-help: <mailto:listar@(protected)?Subject=help>
List-archive: <http://www.highend3d.com/maya/devarchive/>