Subject: getting current time 2003-12-15 - By Berj Bannayan
Back Hi all,
Is there a better (more succinct) way to get the current frame than this?
double getCurrentTime() { MSelectionList selection; MObject time_node_obj; MTime current_time; MPlug out_time_plug;
selection.add("time1"); selection.getDependNode(0, time_node_obj);
MFnDependencyNode time_node(time_node_obj);
out_time_plug = time_node.findPlug("outTime"); out_time_plug.getValue(current_time);
return current_time.as(MTime::uiUnit()); }
This works fine but it seems a little cumbersome (especially when I add in error checking). I feel like I'm missing something.
Thanks, Berj
-- "A cigar is a banana for the monkey of the soul" -- Switters Berj Bannayan - soho vfx - berj@(protected) - 416-591-1400
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- List-help: <mailto:listar@(protected)?Subject=help> List-archive: <http://www.highend3d.com/maya/devarchive/>
|
|