[PXCDD-commit] SF.net SVN: pxcdd: [398] trunk/client/c4d/pxcdd-turntable.cof
Status: Alpha
Brought to you by:
tangentsoft
From: <ric...@us...> - 2006-07-15 21:03:42
|
Revision: 398 Author: ricknroll Date: 2006-07-15 14:03:39 -0700 (Sat, 15 Jul 2006) ViewCVS: http://svn.sourceforge.net/pxcdd/?rev=398&view=rev Log Message: ----------- created basic structure for turntable plugin based on pxcddup Added Paths: ----------- trunk/client/c4d/pxcdd-turntable.cof Added: trunk/client/c4d/pxcdd-turntable.cof =================================================================== --- trunk/client/c4d/pxcdd-turntable.cof (rev 0) +++ trunk/client/c4d/pxcdd-turntable.cof 2006-07-15 21:03:39 UTC (rev 398) @@ -0,0 +1,129 @@ +/*********************************************************************** + pxcdd-turntable.cof - COFFEE plugin for C4D R9.1+ that generates a + turntable animation + + Created 2006.07.13 by Rick Barrett + + Copyright (c) 2006 by Pixel Corps. This program may be used under + the terms of the X11 license, a copy of which should have accompanied + this program, in the LICENSE file. +***********************************************************************/ + +//// class PXCDDTurntablePlugin //////////////////////////////////////// + +class PXCDDTurntablePlugin : MenuPlugin +{ +public: + // ctor + PXCDDTurntablePlugin(); + + // Parent class overrides + Execute(doc); + GetHelp(); + GetID(); + GetIcon(); + GetName(); + +protected: + + +private: + + +} + +//// Execute /////////////////////////////////////////////////////////// +// The main event...run the plugin on the document. + +PXCDDTurntablePlugin::Execute(doc) +{ + /* + + // Set up the options dialog, setting the controls' values to their + // previous ones as stored in the preference file. + var dlg = new(PXCDDUploadDlg); + + var prefs = new(PXCPreferences); + prefs->prefFile = "pxcdd-upload.pref"; + prefs->LoadFile(); + dlg->SetControlData(prefs->GetValues()); + + // Display the dialog, and do the meat of the plugin if user okays + // the dialog. + if (dlg->Open(-1, -1) && dlg->GetResult()) { + // Retrieve the data from the dialog's input controls + var controls = dlg->GetControlData(); + + // Save control data out to our preference file, so we can + // reload it on the next run. + prefs->SetValues(controls); + prefs->SaveFile(); + + } + */ + +} + + +//////////////////////////////////////////////////////////////////////// +// Standard overrides for telling C4D about this plugin. + +PXCDDTurntablePlugin::PXCDDTurntablePlugin() { super(); } // never called!! +PXCDDTurntablePlugin::GetID() { return 1020091; } // registered to Warren Young +PXCDDTurntablePlugin::GetName() { return "PXCDD Turntable"; } +PXCDDTurntablePlugin::GetIcon() +{ + var icoPath=GeGetRootFilename(); + icoPath->RemoveLast(); + icoPath->AddLast("res"); + icoPath->AddLast("upload-icon.png"); + var ico = new(BaseBitmap, 64, 64); + ico->Load(icoPath, 0); + return ico; +} +PXCDDTurntablePlugin::GetHelp() +{ + return stradd("Creates a turntable camera animation"); +} + + +//// ReadVersionFile /////////////////////////////////////////////////// + +ReadVersionFile() +{ + var path = GeGetRootFilename(); + path->RemoveLast(); + path->AddLast("version.txt"); + + var file = new(BaseFile); + if (file->Open(path)) { + var data = file->ReadString(file->GetLength()); + + var i; + for (i = 0; i < sizeof(data); ++i) { + if (isspace(data[i])) { + data = strmid(data, 0, i); + break; + } + } + + return data; + } + else { + return "UNKNOWN"; + } +} + + +//// main ////////////////////////////////////////////////////////////// + +main() +{ + Register(PXCDDTurntablePlugin); + + println("-------------"); + println("Pixel Corps digital dailies turntable script started."); + println("Version ", ReadVersionFile(), ", $Revision: 355 $"); + println("-------------"); +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |