Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Admin
    • Login

    Variables to dialog resource

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 381 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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.

      Thank you.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 19/05/2016 at 02:53, xxxxxxxx wrote:

        Hi,

        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?

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 20/05/2016 at 19:31, xxxxxxxx wrote:

          Hi Yannick,
          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.

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            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()

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post