Navigation

    • Register
    • Login
    • Search
    • Categories
    1. Home
    2. y_puech
    Y
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    y_puech

    @y_puech

    55
    Reputation
    36
    Posts
    219
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online
    Location Madrid, Spain

    y_puech Follow

    Posts made by y_puech

    • RE: UserArea and EditText

      Hi,

      IMHO solution 2 is not the best because the user has to look below in the dialog to edit the text.
      I think solution 1 is the easiest and more convenient, you can simply call c4d.gui.InputDialog() to get the text.
      If you want the input dialog to be shown at the text's location in the user area then you can implement a GeDialog.

      posted in Cinema 4D Development
      Y
      y_puech
    • RE: C4D GUI Python Callback

      Hi,

      A string with format "PLUGIN_CMD_123456" is meant to be used with MENURESOURCE_COMMAND, not RegisterCommandPlugin().
      It tells Cinema the command ID and name for the menu item to be added.
      Note the sub-IDs returned from GetSubContainer() are specific to a command and aren't global to Cinema.

      Maybe CommandData isn't what you really need. Scripts from the user folder are automatically loaded and can be added to any menu using Customize Menus dialog.

      posted in Cinema 4D Development
      Y
      y_puech
    • RE: C4D GUI Python Callback

      Hi and welcome to the new Plugin Cafe!

      It is not possible to pass a Python function for MENURESOURCE_COMMAND. Only a Cinema 4D command resource ID ("IDM_NEU") or a plugin command ID ("PLUGIN_CMD_123456") can be given.

      A CommandData plugin can have sub-ID commands returned from GetSubContainer(). The sub-ID commands are then invoked with ExecuteSubID().
      But there's a limitation with this currently. At least two CommandData have to be registered from the same plugin for the sub-commands to be taken into account.

      Please read and use How to Post Questions and Q&A New Functionality. This time I added tags and turned the thread into a Q&A.

      posted in Cinema 4D Development
      Y
      y_puech
    • RE: Content of PYTHONPATH not appended to sys.path

      Hi Heinrich,

      Welcome to the new forum 😀

      PYTHONPATH not added to sys.path is a known issue and has been already fixed for the R20 SP2 update.
      I don't see a better workaround then your with R20 SP1 currently.

      I turned this topic into a Q&A. Please use this functionality in the future. For more information see Q&A New Functionality.

      posted in Cinema 4D Development
      Y
      y_puech
    • RE: No fbx exporter in python library?

      Hi Rage,

      Unfortunately several importers and exporters do not have a constant for their ID. This is the case for FBX.
      The ID for the FBX exporter is 1026370.

      To find the ID of a specific exporter you can use the following code:

      import c4d
      
      saverPlugs = c4d.plugins.FilterPluginList(c4d.PLUGINTYPE_SCENESAVER, True)
      for plug in saverPlugs:
          print('{} : {}'.format(plug.GetName(), plug.GetID()))
      

      I turned the topic into a Q&A. Please remind to use this feature of the forum.

      posted in Cinema 4D Development
      Y
      y_puech
    • RE: ParseTupleAndKeywords in R20

      Hi Victor,

      There's a logic error in the code you posted from the first post. The condition for R20 if (str.IsEmpty()!=false) returns false if the string has content.
      It makes more sense to call IsPopulated() for the R20 code instead of IsEmpty().

      posted in Cinema 4D Development
      Y
      y_puech
    • RE: ParseTupleAndKeywords in R20

      Hi Victor,

      Only minor changes/fixes have been made to the PythonLibrary and its behavior hasn't changed in R20. So parsing a String with $ should still work fine.

      How do you call the function and pass the string? What's the exact error message?

      posted in Cinema 4D Development
      Y
      y_puech
    • RE: Print console logs in terminal

      Hi,

      As I turned this discussion into a Q&A topic, if you're satisfied with my last post's solution then you can mark it as the correct answer or mark the topic as solved.
      For more information see Q&A New Functionality.

      posted in Cinema 4D Development
      Y
      y_puech
    • RE: Print console logs in terminal

      Hi,

      There's a more convenient workaround than using GePrint().
      sys.__stdout__ original standard output stream can be used to redirect stdout and print to the terminal/console. Here's some code:

      # Stores the stdout redirected by Cinema 4D Python
      c4d_stdout = sys.stdout
      # Redirects to original stdout
      sys.stdout = sys.__stdout__
      
      # Prints something
      print("Some text to be printed to the terminal/console")
      
      # Restores Cinema 4D Python stdout redirection
      sys.stdout = c4d_stdout
      
      posted in Cinema 4D Development
      Y
      y_puech
    • RE: resource errors with SPLINE in R20

      Hi,

      Are you using the Spline GUI inside a dialog? It looks like so if there's no arrow.
      If that's the case you can call SetLayoutMode(c4d.LAYOUTMODE_MINIMIZED) on the Spline custom GUI to change its layout to the minimized/spline element only.

      posted in Cinema 4D Development
      Y
      y_puech