Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. General Talk
    Log in to post
    Load new posts
    • Newest to Oldest
    • Oldest to Newest
    • Most Posts
    • Most Votes
    • Most Views
    • G

      Python Plugin Unicode Convert

      python • • geese780
      4
      0
      Votes
      4
      Posts
      688
      Views

      M

      Just to add on top,
      os.path.listdir and os.path.join in python 2 are context-specific, so if you input a Unicode string it will output a Unicode string, if you input a regular string it will output a regular string.
      Now the culprit is on c4d.documents.MergeDocument because normally this method accepts a C++ Filename object (which is the Classic API that under the hood uses the new MaxonAPI maxon::Url). Unfortunately, the Python parser is not able to convert from a Python Unicode string to a C++ Filename, but only from a Python ASCII string to a filename.

      So indeed casting from Unicode string to ASCII is the solution.
      Cheers,
      Maxime.

    • mikeudinM

      Batch Processor: plugin for python scripts developers

      • • mikeudin
      5
      4
      Votes
      5
      Posts
      1.6k
      Views

      mikeudinM

      @m_adam Thank you!

    • intenditoreI

      Python tag - IsDirty() not working?

      • • intenditore
      11
      0
      Votes
      11
      Posts
      2.2k
      Views

      intenditoreI

      @m_adam thank you, that's really confusing..

    • lasselauchL

      escape unicode characters in filepath

      • • lasselauch
      7
      0
      Votes
      7
      Posts
      1.0k
      Views

      M

      Hi, @lasselauch as a rule of thumb with Python2.7 always store data as a Unicode string.

      Control your IO which means, for each, Input make sure you know the encoding in all cases by always calling .decode('utf-8') so you are sure to store a Unicode value and get an error if something went wrong at a loading time.
      Then output the content according to your need some need ASCII, some can work with unicode, but do the conversion on the fly, don't touch you stored Unicode data.

      For the francophone people, there is this fabulous article about unicode Encoding in Python for English I guess the best I found on this topic is A Guide to Unicode, UTF-8, and Strings in Python.

      Cheers,
      Maxime.

    • I

      SDK examples at Linux

      • • iluxa7k
      4
      0
      Votes
      4
      Posts
      661
      Views

      I

      There are successful builds at CentOS-7.8.2003 by gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5) But i use project tool for R20. Last project tool(S22) asks me libprocs 6. At Ubuntu - normally

      CentOS7.png

    • ferdinandF

      Cinema4D S22 Debian user experiences?

      • • ferdinand
      7
      1
      Votes
      7
      Posts
      1.5k
      Views

      I

      Hello everyone.
      Will be ever C4D for Linux with GUI from Maxon? Not wine emulation.
      Sometimes want to switch linux.

    • M

      Cinema 4D S22 Bevel tool issues.

      • • Muokkaa
      5
      0
      Votes
      5
      Posts
      1.1k
      Views

      M

      Hi @Muokkaa, unfortunately, I wasn't able to reproduce, so I suggest you send a bug report with a file to the user support https://support.maxon.net/open.php.

      This forum is about SDK and plugin development for Cinema 4D, no general Cinema 4D support.
      Cheers,
      Maxime.

    • R

      Flock Modifier

      • • Rambenwal
      8
      0
      Votes
      8
      Posts
      1.6k
      Views

      fwilleke80F

      I didn't take it as rude, don't worry 😉

    • S

      Setting coordinates for selected faces (Python - Beginner)

      python • • SteveLim
      9
      0
      Votes
      9
      Posts
      1.8k
      Views

      M

      You could also retrieve the current matrix of the gizmo with BaseObject.GetModelingAxis.

      Cheers,
      Maxime

    • T

      Python script for Rectangle Selection with options

      • • Tennet
      4
      0
      Votes
      4
      Posts
      648
      Views

      T

      Hi Manuel and @rb_rodrigo,

      Many thanks for the tips about the Python console and help with the code. I'm a beginner (not even that!) in scripting, so much appreciated. It works as expected now!

      Cheers,
      Frederik

    • Danchyg1337D

      This topic is deleted!

      • • Danchyg1337
      1
      0
      Votes
      1
      Posts
      18
      Views

      No one has replied

    • M

      Render to texture transfer for C4D

      • • myosis
      1
      2
      Votes
      1
      Posts
      1.1k
      Views

      No one has replied

    • C4DSC

      Cross platform screencapture code

      • • C4DS
      5
      0
      Votes
      5
      Posts
      764
      Views

      M

      Hi @C4DS, just to confirm that there is nothing built-in Cinema 4D.

      For python most of the library in the end only reroutes through OS call and does have a system dependant call, so you will probably end with something like that also in C++.

      Cheers,
      Maxime.

    • Danchyg1337D

      PluginsHelpDelegate Info

      r21 r20 c++ • • Danchyg1337
      6
      0
      Votes
      6
      Posts
      802
      Views

      ManuelM

      hi,

      there's nothing more to do in R21/S22, you should maybe post your project to see if there's something wrong.

      Cheers
      Manuel

    • SwinnS

      Remove object from layer

      • • Swinn
      4
      0
      Votes
      4
      Posts
      792
      Views

      SwinnS

      @PluginStudent said in Remove object from layer:

      op[c4d.ID_LAYER_LINK] = None

      op[c4d.ID_LAYER_LINK] = None c4d.EventAdd()

      did it! Thanks!
      As you can tell from my previous code, I am hacking my way through Python. If you saw the rest of it, you would probably have to sit down and maybe drink a Gatorade. Or something stronger. 🙂

    • SwinnS

      Hide Layer in Layer Manager

      • • Swinn
      3
      0
      Votes
      3
      Posts
      550
      Views

      SwinnS

      Got it. Thanks.

    • B

      Create Proper Hierarchical Data for TreeView?

      r21 python • • bentraje
      11
      0
      Votes
      11
      Posts
      1.5k
      Views

      B

      Thanks for the clarification.
      Have a great day ahead!

    • S

      Python - InExcludeData initialization problem

      • • SolarPH
      5
      0
      Votes
      5
      Posts
      1.0k
      Views

      ferdinandF

      Hi,

      @SolarPH said in Python - InExcludeData initialization problem:

      Now I know that initializing the InExcludeData is not InExcludeData.__init__ and the correct way was c4d.InExcludeData(), ...

      I am not quite sure how you did mean this, but InExcludeData.__init__ is one of the methods called when you invoke c4d.InExcludeData(). Like all double underscore methods __init__ implements an operator, in that case the construction operator. Invoking SomeClass() will first call the constructor SomeClass.__new__ and after that the initialisator SomeClass.__init__. Due to the fact that __new__ only rarely has to be implemented explicitly and because people are accustomed to talking about constructor functions, __init__ is also often called a constructor, while technically it is just the initialisator. A prime example would be both the InExcludeData documentation and my example code, which both talk about a copy constructor, but are actually referring to __init__ and not __new__.

      Cheers,
      zipit

    • B

      Access Class B's function inside Class A?

      r21 python • • bentraje
      5
      0
      Votes
      5
      Posts
      758
      Views

      B

      @Cairyn @zipit @C4DS

      Thank you all for the responses.
      I ended up with @C4DS suggestion in using SpecialEventAdd() and CoreMessage for simplicity sake.

      Have a great day ahead!

    • V

      Question about IDs for Python Dialog

      python • • vevi
      3
      0
      Votes
      3
      Posts
      534
      Views

      ManuelM

      hi,

      I'll set this thread as solved without feedback from your side.

      Cheers,
      Manuel