Interact with Plugin Dialog [R21][Win][python]
-
Hi all,
I'm new to C4D and to the forum (so please forgive me if I'm not posting correctly).
As the title suggests, I'm struggling to figure out how to interact with a Plugin Dialog...
After hours of searching online for a solution, the closest I got was this post - which doesn't seem to have a solution. ={
Basically, I'm writing a script to automate the setup of assets in C4D... It imports models from one or more FBX files and then needs to apply some textures to them. I need to use an existing plugin to set up and apply the textures...
I have the plugin ID, and I can load it with CallCommand, but then I can't seem to interact with the dialog at all. ={
I've tried to use the CallButton and CallFunction commands, but get no response or return from them...?
Any help would be very much appreciated.
Thanks,
Phil -
Hi,
welcome to the forum. The most important thing to understand is that Cinema has two methods of describing GUIs: dialogs and descriptions. You can find more information about them here.
c4d.CallButton()
is only meant to work with descriptions and.CallFunction()
is not related to your problem. So, if the plugin presents its GUI as a dialog, you are out of luck.It is difficult to give you any further advice without more information.
- Post the code you have written. It is impossible to see what is going wrong otherwise.
- Specify as precisely as possible what you are doing. Examples or simplifications (e. g. : I need a plugin, better: I need the plugin XYZ) are usually counterproductive.
It is also worth mentioning that this scripting style of chaining commands to the application - a style one might be used to from other packages - is usually not the way to go in Cinema.
Cheers
zipit -
hello and welcome to the forum,
First, for your next threads, please help us keeping things organised and clean. I know it's not your priority but it really simplify our work here.
- Q&A New Functionality.
- How to Post Questions especially the tagging part.
I've added the tags and marked this thread as a question so when you considered it as solved, please change the state
About you question :
We need to have a bit more informations. Are you coding in the script manager or somewhere else ? (python generator, python tag, a plugin)
we have an example on how to import an obj that can be adapt to fbx.
We also have an example on how to create material and assign to an objet
And of course lots more examples that could help you to understand how it work.
Of course don't hesitate to ask question on this forum.
Cheers,
Manuel -
Hi zipit, Manuel...
Thanks for the replies.
@Manuel, I did have a quick scan of the "How to Post Questions" post, but obviously misunderstood the tagging part. I added the "tags" in the title! =P Will be sure to look more closely next time.
Ok, I'll try to flesh out the details a bit more...
The steps are like this :
- A standalone Python app allows the user to specify multiple "assets" to process.
- Each asset has one or more fbx files and a set of textures.
- The app writes out a "process" text file (with all the relevant data) for each asset to a process directory and then launches C4D.
- I have a very basic ".pyp" file in the plugins directory that calls my python "processing" script on launch.
- This script gets the list of "process" files and then iterates through them :
- The FBX file(s) are imported into a fresh scene.
- The plugin is loaded. (it's this one here - used to set up materials specifically for different renderers)
Here is where I'm stuck. At this point I need to be able to : - Set a number of variables in a "c4d.gui.GeDialog" class...
- Call a number of functions from the same class...
Essentially, I need to be able to access variables and functions within a GeDialog class instance that has been loaded by a plugin... (I think that's the right way to put it)
Thanks again,
Phil -
Hi,
that is not possible. The
GeDialog
of aCommandData
plugin that you do not own, is not accessible to you (at least I am not aware of a way to do so).Cheers
zipit -
Hi zipit,
I thought that might be the case... ={
Ah well - I'll have to figure out another way... Thanks for your help.
-
hello,
I'll mark this thread as solved tomorrow if you have nothing to add.
Cheers,
Manuel