View Single Post
# 8 05-10-2013 , 01:48 PM
ieoie's Avatar
Registered User
Join Date: Aug 2007
Location: The Netherlands
Posts: 88

Next script step......

You don't have to create a new topic since this is all part of the same project. There is a scripting section though. I haven't seen a lot of talk about Kinect on here and I personally don't use it so all I can do is help you with your mel scripts lol.

I'm having a lot of trouble visualizing your problem. Do you have any screen shots and mock ups of what you want this thing to look like and function?


thank you.......

is this sufficiant.....
else i will make a small youtube.....
or maybe we can do screenshare through Skype and share the findings on the forum......???


//-------------------------------------------------------------------------------

global proc RT_Check ()
{
//......... expres. on locator runs every frame this procedure... "RT_Check ()".............
spaceLocator ;
rename |locator1 "tracker01" ;
addAttr -ln "expr_Pull_Frame" -at long |tracker01;
setAttr -e-keyable true |tracker01.expr_Pull_Frame;

int $curFrame =`currentTime -q` ;
int $prevFrame = $curFrame - 1 ;
print ($prevFrame + " Previous \n") ;
print ($curFrame + " Current \n") ;

select -r tracker01 ;
delete ;

//........ Tracking the state of the Atribute........
int $trackCheck01 = `getAttr pSphere1.inP01` ;
//int $emptyCall = 0 ;
print ($trackCheck01 + " Visible Status \n") ;

//........ What to do whith what state............
if ( $trackCheck01 == 1 )
{ print "Green \n" ;
switchMoment ($curFrame, $prevFrame, $trackCheck01);
//string %colGreen = `textField -rgb 0 1 0` ;
}
else
{ print "Red \n" ;
//string %colRed = `textField -rgb 1 0 0` ;
}


/* this way i hope to define/add a check that he only returns the frame when it is turned on, and not every frame after that aswell
//....................... if current frame (pSphere1.inP01 = 1)
//....................... and previous frame (pSphere1.inP01 = 0),
//.......................than give only this current frame nr, ........(this value i then use as start for the animation......)

//....................... if current frame (pSphere1.inP01 = 1 )
//....................... and previous frame (pSphere1.inP01 = 1 ),
//.......................than do nothing
*/

//passFrames ( $curFrame, $prevFrame ) ;
print "\n" ;
}

//---------------------------------------------------------------------------------------

global proc switchMoment (int $curFrame, int $prevFrame, int $trackCheck01)
{
//.... here i have to define he only gives the one frame the swith goes on,
//.... else he keeps recalculation this rule every frame, and need to fetch just that one frame it switches
if ( $trackCheck01 == 0 )
{
print "Non-Active \n" ;
}
else
{
print ($curFrame + " Start Frame \n") ;
//string %colRed = `textField -rgb 1 0 0` ;
}

if ( $trackCheck01 == 1 )
{
print "STOP Non-Active \n" ;
}
else
{
print ($curFrame + "STOP Start Frame \n") ;
//string %colRed = `textField -rgb 1 0 0` ;
}
}

//------------------------------------------------------------------
//------------------------------------------------------ EXPERIMENT-

// ........ here i am trying to find a way to to make an intfield that i can load in the menuDisplay (FrameTools)
// ...This way i think i can get some of the fields in the window real-time.....
//.Because when i now connect this FrameTools window directly to the RT_Check the whole window turns on and of every frame
//so i need to bridge this somehow...so the window updates only some specific fields each frame....

global proc passFrames (int $curFrame, int $prevFrame)
{
print ($prevFrame + " Previous \n") ;
print ($curFrame + " Current \n") ;
//string $curUpd01 = `intField -v $curFrame` ;
//string $prevUpd01 = `intField -v $prevFrame` ;
}


//------------------------------------------------------------------
// -------------------------------------------- MAKING PRIME MENU --
//------------------------------------------------------------------
proc menuDisplay ()
{
if (`window -exists flow_toolsUI`)
deleteUI flow_toolsUI;

//string $Try = `passFrames (int $curFrame, int $prevFrame)` ;

float $startFrame = `currentTime -q`;
float $prevFrame = $startFrame - 1 ;
string $animLength1 = "50 fr" ;
string $animLength2 = "75 fr" ;
string $animLength3 = "100 fr" ;
string $animLength4 = "150 fr" ;

window
-width 300
-sizeable false
-t "FrameTools"
-iconName "ieoie Tools"
-mxb off
flow_toolsUI;

rowColumnLayout -numberOfColumns 1
-columnWidth 1 300
columnLayout;
text "";
text "Real-Time On/Off Check";
text " ";
setParent ..;

rowColumnLayout -numberOfColumns 2
-columnWidth 1 150
-columnWidth 2 150

columnLayout;
text "Current Frame";
text "Previous Frame";
intField -v $startFrame -editable true inP_CF ; //... this one should be connected with RT_Check (it does not update real-time now)
intField -v $prevFrame -editable true inP_PF ; //... this one should be connected with RT_Check (it does not update real-time now)
setParent ..;
text " ";
setParent ..;

frameLayout -w 400 -h 500 -label "Tracked Object Stats";

string $objectsIntrace1 = `rowColumnLayout -numberOfColumns 5
-columnWidth 1 100
-columnWidth 2 50
-columnWidth 3 50
-columnWidth 4 50
-columnWidth 5 50`;

text " ";
text "Start";
text "Length";
text "Stop";
text " " ;

text -l "Tracked Object 001";
intField -editable true inP1_CF ; //... here comes the start frame of the animation
textField -it $animLength1 -editable false animL1 ;
intField -editable true inP2_CF ; //... here comes the end frame of the animation
text -ebg true -bgc 1 0 0 "On/Off"; //... this color should go green when active, and back red when done

text -l "Tracked Object 002";
intField -editable true inP3_CF ;
textField -it $animLength2 -editable false animL2 ;
intField -editable true inP4_CF ;
text -ebg true -bgc 1 0 0 "On/Off";

setParent ..;
setParent ..;

text "Testing real-time notification";

showWindow flow_toolsUI;
}

menuDisplay ;

Attached Files
File Type: zip 0000_FLOW_EXPRESSION_TEST.zip (8.6 KB, 407 views)

*
The Universe is larger then you ever can think, But smaller then the size of your imagination.

all are welcome at www.ieoie.nl

Last edited by ieoie; 05-10-2013 at 01:51 PM. Reason: Forgot Attachement