View Full Version : Coffee Script: Toggle Saveframe
Hello
Iam starting to learn coffee scripting in my sparse freetime, but iam already stuck at the beginning point.
I want to create a simple "toggle Saveframes" Script.
I found out the the "comand" is named
#BASEDRAW_DATA_SHOWSAFEFRAME
but now i dont know how to handle it
i tried to println its status or asign it to a variable ... or even tried the GeData function of the BaseDraw Class ... but i only get errors.
So how do i use this "Comand" #BASEDRAW_DATA_SHOWSAFEFRAME to acess ist status and manipulate it ?
thanks in advance
regards mogh
|
|
Darter
01-23-2008, 11:10 PM
You have to access the base draw using GetActiveBaseDraw(). This is listed in the SDK under the BaseDocument class. So to toggle Safe Frames you can use:
doc->GetActiveBaseDraw()#BASEDRAW_DATA_SHOWSAFEFRAME =
!doc->GetActiveBaseDraw()#BASEDRAW_DATA_SHOWSAFEFRAME;
Take a look at this thread (http://forums.cgsociety.org/showthread.php?f=182&t=330902) for more examples.
Thank you very much, Darter
it works perfectly, know i just have to wrap my head around that little piece of code to learn something.
i would have written a hole page of code presumably as a beginner hehe.
hm what makes me curoius is how to fin the right class in the sdk because the saveframe comand is not listed only some Savefram types ... and these are even not in the active draw class.
so how do i find "out" that the
#BASEDRAW_DATA_SHOWSAFEFRAME is in the class of GetActiveBaseDraw() ?
thanks again
regards mogh
Darter
01-24-2008, 12:18 PM
It's a combination of asking questions as you've done here, searching forums, doing tutorials and familiarising yourself directly with key areas of the SDK such as the base classes.
Searching the SDK for 'base draw' takes you to BaseDocument and hence GetActiveBaseDraw(). Of course you have to get there from the parameter name but coding often involves finding improbable chinks to jam your crowbar into. Or bashing your head repeatedly against the wall from as many different angles as possible until it starts to crack.
If you're stuck, one of the first places to look for answers is Plugin Café: http://www.maxon.net/pages/support/plugincafe_e.html. It is frequented by experienced programmers and a wealth of information can be found in the forum archives, along with plenty of working code.
rui_mac
01-24-2008, 11:07 PM
Like I said on my book, finding out how things are done involves some deep detective work.
For example, I was searching for info about the BaseSelect class and what commands can I use with it. There was almost zilch in the COFFEE sdk. The only place I found some information was in the C++ documentation.
I usually perform searches inside the files of the sdk and, sometimes, inside the Cinema4D folder too. It really helps to have an application that can perform a search on the contents of files that reside inside a specific folder. I use TextWrangler for it.
Rui Batista
rui_mac i buyed your bock ... but ime is limited at the moment ..
darter thanks again for the reply
regards mogh
CGTalk Moderation
01-28-2008, 07:06 PM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.