On 21/11/2015 at 13:04, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 16
Platform: Windows ;
Language(s) : C.O.F.F.E.E ;
---------
Hello guys, I'm not a programmer but I like to try creating small solutions for my day to day.
I have wrote this script in COFFEE in order to quickly adjust some parameters in Render Settings. It's working fine but I wanted to improve it.
I wanted to automatically clear the save path if the condition IsEmpty was FALSE.
The solution I found was a popup requesting to user do it manually.
Anyone knows how can I do it (clear the save path)?
Thanks
Below, the C.O.F.F.E.E. script:
// Activate Save Image
if (renderdata()#RDATA_SAVEIMAGE=FALSE)
return NULL;
else(renderdata()#RDATA_SAVEIMAGE=TRUE);
var save_path=renderdata()#RDATA_PATH; // Store the currently save path
var file_name=doc->GetFilename()->GetLastString(); // Capture the name of c4d project
if (save_path->IsEmpty())
{
save_path->AddLast(file_name); // Add the c4d project name to save path
save_path->DelSuffix(); // Remove .c4d extension
renderdata()#RDATA_PATH=save_path; // Load it in the Save field
// Avoid duplicated name
// save_path->RemoveLast();
// renderdata()#RDATA_PATH=save_path;
renderdata()#RDATA_XRES_VIRTUAL=800; // Width
renderdata()#RDATA_YRES_VIRTUAL=600; // Height
renderdata()#RDATA_FORMAT=1104; // JPG format
CallCommand(12099); // Render to Picture Viewer
}
else
{
CallCommand(12161); // Edit Render Settings...
TextDialog("Clear the save path!", GEMB_OK);
}