Maxon Developers
    • Downloads
      • All Downloads
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
      • Cinema 4D Python Examples
      • Cinema 4D C++ Examples
      • Project Tool
      • SDK Database
    • Documentation
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
    • Forum
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Forums
      • Overview
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • News & Information
      • Downloads
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login
    1. Home
    2. Tags
    3. python
    Log in to post
    • All categories
    • CairynC

      What's the state of Ngons in Python?

      Cinema 4D SDK
      • python classic api r21 • • Cairyn
      9
      0
      Votes
      9
      Posts
      300
      Views

      CairynC

      @m_magalhaes said in What's the state of Ngons in Python?:

      About the bugs on the forum, we have introduce few month ago new tags "Bug report" and "Bug Fixed". We are also adding some tag in our bug database to retrieve faster the post on the forum. I know it's not perfect and sometimes we may forgot to add this tag on the first post of the thread. But it's better than nothing.

      Yeah, I'll try to use that in the future although it probably won't affect existing threads (a lot of valuable knowledge still resides in the "old forum" parts).

      @Cairyn said in What's the state of Ngons in Python?:

      Anyway, I don't think this issue is of huge interest as you said there's a replacement in the new kernel already, which will probably come with a diferent tesselation algorithm, so I present it here as a curiosity.

      Don't get me wrong, all modeling command have been migrated to the new modeling kernel. If you are using SendModelingCommand, it will use the new kernel.
      So what you see now in S22 and R23 (ok you will see in R23) IS the new kernel. There will be no better tesselation.
      I consider this as a bug.

      As a Perpetual user, I'm still on R21 (as tagged) so is this also the new kernel? AFAIK the new kernel has been working behind the API for a while now, being gradually introduced into the functionality, so it's possible that this bug still persists.

      I can't test it on a demo of S22 for you, as the current licensing does not allow me to install one.

      The new modeling kernel isn't exposed yet. But it is used. I understand, it's a bit confusing. We are moving Cinema4D to the new core. But as long as some part of Cinema4D are using the old system (object manager for exemple), the new core need to "translate" that to the classic API. (...)
      I hope it's clear.

      Sure, I have a few decades of programming under the belt. It's just a bit difficult as non-Maxon developer to see the details. Seeing only the API (and therefore the user-side of the translation layer), I can't always tell what the underlying data model really is; what's stored as attribute, what's calculated on the fly, what's internally cached for fast access, what's abstracted and what's plainly stored... I may make wrong assumptions on the internal workings.

      this look like a valid ngon but i will ask 🙂

      It probably is valid - I don't see a reason why it should be forbidden. I just notice that the tesselation algorithm tends to avoid such "inner polygons". That may not be intentional (based on a rule) though, but just a consequence of how the algorithm works.

      Thanks again,
      -- Cairyn --

    • indexofrefractionI

      Access Python Tag Globals from outside

      Cinema 4D SDK
      • python • • indexofrefraction
      10
      0
      Votes
      10
      Posts
      307
      Views

      indexofrefractionI

      Thanks zipit and Maxime,

      I use the MSG_BASECONTAINER solution now,
      thanks for the example !

      one question here:
      you always return True from the message() function
      is that necessary?

      the docs here
      https://developers.maxon.net/docs/py/2023_2/manuals/introduction/python_tag.html?highlight=python plugin
      just says :
      Return type: bool
      Returns: Depends on the message type.

      ...

      and a bit off topic :
      is there a message, when a python tag or generator gets enabled / disabled by the (generator) switch in the object manager?
      can i catch that?

    • CairynC

      What is the max parameter in BaseSelect.GetRange() really for?

      Cinema 4D SDK
      • r21 python • • Cairyn
      7
      0
      Votes
      7
      Posts
      286
      Views

      CairynC

      yupyup, BaseSelect has no connection to the original object it actually selects from, not even in the cases where you get a pointer to the BaseSelect returned and change the selection directly through it.

      That's why we need the max parameter for SelectAll and ToggleAll -- the BaseSelect doesn't know what "all" even is. (Not GetLastElement()!) For GetRange() though, that reasoning does not apply.

      Now let's see whether I can crash C4D with inconsistent edge selections...

    • N

      Get Point Positions of Selected N-Gon or Polygon

      General Talk
      • • • noseman
      11
      0
      Votes
      11
      Posts
      831
      Views

      X

      Hi:

      This is a bit of a hassle, but can still be scripted, who CARES about an extra polygon.

      import c4d def main(): polygons = op.GetAllPolygons() points = op.GetAllPoints() point = [c4d.Vector(10000, 10000, 10000),c4d.Vector(9999, 10000,10000), c4d.Vector(9999, 10000, 10001),c4d.Vector(10000, 10000, 10001)] point_indexe = [[len(points) + i ,point[i]] for i in range(len(point))] op.ResizeObject(len(points) + len(point),len(polygons) + 1) set_point = [op.SetPoint(k[0], k[1]) for k in point_indexe] op.Message(c4d.MSG_UPDATE) c4d.EventAdd() if __name__=='__main__': main()
    • gheyretG

      ToolPlugin Problems

      Cinema 4D SDK
      • python s22 r21 r20 r19 • • gheyret
      7
      0
      Votes
      7
      Posts
      366
      Views

      kbarK

      @gheyret great to hear! Looking forward to seeing what it is you are creating.

    • AwesuusA

      S22: c4d.MCOMMAND_SPLIT returns a Bool instead of a List, while it returned a list in R21 and earlier versions

      Cinema 4D SDK
      • • • Awesuus
      5
      0
      Votes
      5
      Posts
      278
      Views

      AwesuusA

      Thank you so much, this works like a charm!!!

    • ?

      Requests for GeClipMap Class

      Cinema 4D SDK
      • • • A Former User
      3
      0
      Votes
      3
      Posts
      176
      Views

      ?

      @m_magalhaes Thanks, Manuel! 👍

    • ?

      MultiLineEditText Documentation

      Cinema 4D SDK
      • python • • A Former User
      3
      0
      Votes
      3
      Posts
      136
      Views

      ?

      @m_adam Thank you for the update, Maxime!

    • bacaB

      Store generator's property

      Cinema 4D SDK
      • python • • baca
      4
      0
      Votes
      4
      Posts
      217
      Views

      ManuelM

      hi

      can we considered this thread as resolved ?

      Cheers,
      Manuel

    • A

      Controlling tessellation of c4d.SplineObject in python

      Cinema 4D SDK
      • python classic api • • android
      5
      0
      Votes
      5
      Posts
      223
      Views

      CairynC

      @android Here's a thread for reference regarding the limitation of a Generator spline:
      https://developers.maxon.net/forum/topic/12596/is-it-possible-to-get-a-spline-wrap-object-to-use-a-python-generated-spline

    • CairynC

      How to use GetPolygonW/R under Python? ...if at all

      Cinema 4D SDK
      • r21 python c++ • • Cairyn
      4
      0
      Votes
      4
      Posts
      156
      Views

      ferdinandF

      Hi,

      jeah, that is probably somewhat the reason. Although Python has true statically typed arrays, which also can be used to directly in-place manipulate C arrays (i.e. array.array), from what I understand it is quite cumbersome to achieve such linkage. This is probably the reason why Maxon does not bother in this case and others like for example vertex colors. Including these access points is still a bit puzzling though. Maybe they are somehow used internally? But I cannot think of a case where this would make sense.

      Cheers,
      zipit

    • mfersaouiM

      Toggle bitmap button on .res file

      Cinema 4D SDK
      • python • • mfersaoui
      4
      0
      Votes
      4
      Posts
      240
      Views

      ManuelM

      hi,

      Group is the key in UI. Simply add a SCALE_H; property for your slider. so for that two columns group, the slider will take all the place minus the button.

      GROUP { COLUMNS 2; REAL ONEFLOAT { CUSTOMGUI REALSLIDER; SCALE_H;} BITMAPBUTTON BUTTON_ID { SIZE 16; TOGGLE; BUTTON; ICONID1 5160; ICONID2 5159; } }

      Cheers,
      Manuel

    • B

      Re-performing Hair Edit > Convert from Spline Command?

      Cinema 4D SDK
      • r21 python • • bentraje
      5
      0
      Votes
      5
      Posts
      286
      Views

      B

      @m_magalhaes

      Thanks! It works as expected.
      So that's what you mean by UniformToNatural. Basically, even if the segment guides are not the same as spline points, it will conform to its overall shape.

    • B

      Changing Face Normal's Direction?

      Cinema 4D SDK
      • r21 python • • bentraje
      5
      0
      Votes
      5
      Posts
      262
      Views

      ManuelM

      hi,

      everything have been said, nothing to add here 🙂

      Cheers,
      Manuel

    • oli_dO

      Problem with TreeViewFunctions.HeaderClick in c4d r20, 21 22

      Cinema 4D SDK
      • python r20 r21 s22 • • oli_d
      3
      0
      Votes
      3
      Posts
      144
      Views

      ManuelM

      hi,

      Since R20, arguments have been added, and the problem is coming from the last one 🙂

      def HeaderClick(self, root, userdata, lColID, lChannel, bDblClk, mouseX, mouseY, ua):

      I've opened a bug report

      Cheers,
      Manuel

    • I

      Write to C4D console in real time

      Cinema 4D SDK
      • python • • ivodow
      14
      0
      Votes
      14
      Posts
      835
      Views

      indexofrefractionI

      @ivodow
      how is your ConsolePrint() different to a simple print() statement?
      in my test i didn''t get a real time output with ConsolePrint()

      best, index

    • K

      Mirror without duplicate using `MCOMMAND_MIRROR`

      Cinema 4D SDK
      • s22 python • • kisaf
      12
      0
      Votes
      12
      Posts
      498
      Views

      ManuelM

      Hi,

      This have been fixe and will be available in a futur update.

      Cheers,
      Manuel

    • fuchsundvogelF

      Generator plugin and loading preset objects from file (cache issue?)

      Cinema 4D SDK
      • python • • fuchsundvogel
      11
      0
      Votes
      11
      Posts
      286
      Views

      ManuelM

      hi

      can we considered this thread as solved ? (even if there's no real right answer)

      Cheers,
      Manuel

    • ?

      Creating a Python Script box

      Cinema 4D SDK
      • python • • A Former User
      3
      0
      Votes
      3
      Posts
      162
      Views

      ManuelM

      hi,

      except what @zipit said, there's nothing outof the box that you can use in our API to do it.
      You have to come with your own solution.

      Remotion have create such a tool few years ago:
      https://bitbucket.org/remotion/code-editor-gui-for-c4d/downloads/

      I would say that it's not really hard to do, it's just long and during the path you are walking to build such a tool, you could find some walls that you didn't expect ^^'

      I would start using the function GetDParameter, check the content and change the color of some words accordingly.

      Cheers,
      Manuel

    • mfersaouiM

      Change the default name of ID_OBJECTPROPERTIES

      Cinema 4D SDK
      • python • • mfersaoui
      3
      0
      Votes
      3
      Posts
      207
      Views

      mfersaouiM

      @m_magalhaes said in Change the default name of ID_OBJECTPROPERTIES:

      DEFAULT 1;

      Thank you much.