Script GUI?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/03/2006 at 10:56, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 9.5
Platform:
Language(s) : C.O.F.F.E.E ;---------
I have asked this elsewhere not knowing if scripts are covered here, but got pointed back here anywayI have a question and I can't figure it out from the SDK - can all of the GUI elements be accessed from a script? I assume yes, because I can easily use TextDialog.
I would like to take something like a group of similar scripts and put them into one script with checkboxes, buttons or pulldowns to reduce the number of scripts in the menu and to combine similar functions. Can it be done?
Any example scripts showing the GUI elements?Thanks
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/03/2006 at 11:36, xxxxxxxx wrote:
If they are your scripts, then it should be easy.
If they are miscellaneous third-party scripts (esp.: COFFEE cobs or SDK plugins), I doubt it. Since cobs and SDK plugins are compiled, you don't have access to the inner workings. SDK plugins are compiled static libraries (.lib).
On the other hand, if you just want a dialog that has, say, a drop-down list of available plugins to launch, that is doable I would think.
Cinema 4D does have the 'docking' capabilities, but I don't think control over this is exposed to plugin developers. It is handled internally by the application out of developer's hands.
If you could be more specific, that may help. For instance, are you discussing the plugins available in the main "Plugins" menu?
Thanks
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/03/2006 at 11:56, xxxxxxxx wrote:
Ok more specifics - first thanks for the reply Robert. I wrote to you awhile back and it didn't seem to get through. I am up the road from you in Boulder - we seem to have a few of the same interests - anyway:
So I have lets say 5 scripts that I have put together that create objects based on mathimatical fomulas. They work fine, but it means 5 similar one trick pony scripts in the menu. I would like to create a dialog that pops up with buttons for all 5 and when I click a button, it runs the appropriate part of the script.
I have wanted to do these as plug ins - I actually have lots of this little stuff, but I just haven't been able to get my head around the plugin syntax - so this might be a way to get there.
thanks again
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/03/2006 at 12:48, xxxxxxxx wrote:
One way to do this would be to combine the 'scripts' or include them all into a mother script. The mother script would be a MenuPlugin with a GeDialog. I'm assuming here that each script has its own dialog for setting parameters. If so, you'd need to combine these dialogs into the mother dialog since COFFEE doesn't have SubDialog support (which would have made this easy to convert the dialogs into subdialogs, that is, tabs).
If you want to just launch the individual script (if it doesn't have a GUI or you want less work), a better approach would be to create the mother script/dialog and just add buttons for each script to be run. In order to run the script, the button should call 'CallCommand(<your plugin id>)' according to the 'id' received by the dialog's Command() method. Something like this, where 'GADGET_MENU1' (et al) are the button IDs and 'pluginID_1' (et al) should be the actual unique Plugin IDs received here from PluginCafe for each of the scripts.
MyDialog::Command(id,msg) { switch (id) { case GADGET_MENU1: CallCommand(pluginID_1); break; case GADGET_MENU2: CallCommand(pluginID_2); break; case GADGET_MENU3: CallCommand(pluginID_3); break; } }
You can even get the plugin's 'name' by using GetCommandName(<pluginID>).
Take care,
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/03/2006 at 12:58, xxxxxxxx wrote:
Well - I think you have the idea. Many of these don't need any input, some do.
But, you lost me once you started talking about the plug in stuff - that is what I don't get. I have gotten a couple of simple ones to work, but gave up. For some reason I can't seem to get the hang of the plug in structure.Thanks anyway
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/03/2006 at 15:05, xxxxxxxx wrote:
Are all of these scripts .cof files that show up in the "Plugins" menu? If so, you could pass them to me via email and I'll build you the 'mother of all scripts!' so that you can launch them from the one. Now, I don't know if those scripts can themselves be hidden from the "Plugins" menu. You can do this in the C++ SDK, but I'd have to check to see if it can be done via COFFEE.
Heck, I wrote my little SplitSymmetry (for Win, Winx64, MacOS, and MacUB) in one day and a little Point/PolygonSelectionTag->VertexMap in 45 minutes.
Let me know. I think you have my email, but if not just PM me here.
Take care,