Variables to dialog resource
On 18/05/2016 at 15:57, xxxxxxxx wrote:
Sorry if this is a newbie question. I'm making a python exporter and I'd like to show version of the plugin in the header and also a name of the object the user is exporting.
For example: "You are exporting object: " + op.GetName()
In script it was easy, I used a global variable, but now I'm trying to rework the script into a plugin and I don't understand how to get it into the . res file.
The string part comes from a .str resource, I got that... but where do I append the variable? I'm new to python modules as well and I guess the answer lies there somewhere.
On 19/05/2016 at 02:53, xxxxxxxx wrote:
What kind of plugin are you developing? A SceneSaverData? A CommandData?
Also do you want to set the title of the dialog or the text for another gadget?
On 20/05/2016 at 19:31, xxxxxxxx wrote:
an open source plugin that exports meshes from the scene to json format, compatible with three.js webgl library. I have it working as a script and now I'm trying to rework it into a plugin.
I'd like a version number in the title of the dialog (preferably from a variable, appended to the name of the plugin) and selected object name also appended to a string in static text gadget in the dialog.
Can it be done? It was possible in the script. Should I share the code?
Thanks for helping me out.
On 21/05/2016 at 04:45, xxxxxxxx wrote:
Sharing the code (only the relevant part, ideally still runnabld) would help.
You can set the text on the title bar of a dialog with GeDialog.SetTitle()
On 23/05/2016 at 06:26, xxxxxxxx wrote:
Ah, ok that's a way to do it. I was looking for a way to access variables from the dialog template and it didn't occur to me I can set it after the dialog is loaded from the python code. Thanks for nudging me in the right direction. :) Problem solved then.