PDA

View Full Version : Mel Script to Track Time Worked?


GiarcNamwob
09-29-2006, 03:56 PM
Looking to create a script that would query the system time and append to a node within the scene file. This is to keep track of amount of time spent on different aspects of a project so that I can propose billing to clients as well as facilitate better time management on my projects....
I'm thinking a scriptjob that can travel with a scene and execute on open and close of project....

Any help would be greatly appreciated.....

Robert Bateman
09-29-2006, 04:07 PM
then you want to create a scriptNode, not sure if there's a portable way of getting the time though. You might need to call some external app via system

sunit
09-29-2006, 05:24 PM
if you're on windows:

system("DATE/T")

-sunit

GiarcNamwob
09-29-2006, 07:46 PM
got this so far... to print to a file... needs formating so that it prints in column form...
and then I need it to print to a node in maya.....

global proc runPunchItToFile()
{
string $currentUser = `pwd`;
string $punchDate = `about -cd`;
string $punchTime = `about -ct`;
string $currentFileName = `file -q -sn`;
$exampleFileName = ( `internalVar -userTmpDir` + "workLog.txt" );
$fileId=`fopen $exampleFileName "a"`;
fprint $fileId $currentUser;
fprint $fileId $currentFileName;
fprint $fileId $punchDate;
fprint $fileId $punchTime;
fclose $fileId;
};

GiarcNamwob
10-02-2006, 03:05 AM
//Creates sphere to record Punches

sphere -n "WorldClock";

//Turns render effective variables off

setAttr "WorldClockShape.visibleInReflections" 0;

setAttr "WorldClockShape.visibleInRefractions" 0;

setAttr "WorldClockShape.castsShadows" 0;

setAttr "WorldClockShape.receiveShadows" 0;

setAttr "WorldClock.visibility" 0;

//Hides Channels not needed

setAttr -k off |WorldClock.rotateX;

setAttr -k off |WorldClock.rotateY;

setAttr -k off |WorldClock.rotateZ;

setAttr -k off |WorldClock.scaleX;

setAttr -k off |WorldClock.scaleY;

setAttr -k off |WorldClock.scaleZ;

setAttr -k off |WorldClock.translateX;

setAttr -k off |WorldClock.translateY;

setAttr -k off |WorldClock.translateZ;

setAttr -k off |WorldClock.visibility;

//Stores Curent Time and Current Date

string $currentSysTime = `about -ct`;

string $currentSysDate = `about -cd`;

//Add attribute and sets it's value

addAttr -dt "string" -ln "PunchDate" WorldClock;

setAttr -type "string" "WorldClock.PunchDate" $currentSysDate;

addAttr -dt "string" -ln "PunchTimeIn" WorldClock;

setAttr -type "string" "WorldClock.PunchTimeIn" $currentSysTime;

All I need now is for it to add a date and time punch in sequence.... can anyone help with a counter to add a number to the end of the attributes added?

CGTalk Moderation
10-02-2006, 03:05 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.