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. mfersaoui
    3. Topics
    • Profile
    • Following 0
    • Followers 0
    • Topics 45
    • Posts 150
    • Best 2
    • Controversial 0
    • Groups 0

    Topics created by mfersaoui

    • mfersaouiM

      Dynamics Body Tag & GetVirtualObjects

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

      ferdinandF

      Hello @mfersaoui,

      Without any further questions, we will regard this topic as solved and flag it accordingly by Monday, September, the 8th.

      Thank you for your understanding,
      Ferdinand

    • mfersaouiM

      Placing a custom menu under the File Menu and on specific position

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

      mfersaouiM

      @mfersaoui
      Hi,
      I found the following solution:

      FileMenu = c4d.BaseContainer() resource = c4d.plugins.GeResource() resource.InitAsGlobal() FileMenu.InsData(c4d.MENURESOURCE_SUBTITLE, resource.LoadString(12587))
    • mfersaouiM

      External dependencies question

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

      M

      Hi @mfersaoui there is nothing wrong with the way you are doing, but I would like to point out that the sys.path is a global variable shared over the current python environment. Meaning that 3rd party will be able also to import your own module so it's recommended to have an ambiguous name (e.g. if your module1.py is called util.py) people will be able to do import util and this can be really misleading so it's preferred to have a unique name (maybe you can start with a prefix).

      Finally, the solution offered by @mp5gosu is the cleanest one as it will create a local import space, so your util.py will only be importable by your own pyp file that actually calls the local import so it's so far the cleanest way as you are not "polluting" the global sys.path.

      But which one is the best, only you can decide according to what you are aiming to produce.
      Cheers,
      Maxime.

    • mfersaouiM

      TreeView Menu

      Cinema 4D SDK
      • python • • mfersaoui
      6
      0
      Votes
      6
      Posts
      1.2k
      Views

      ferdinandF

      Hi,

      without further feedback, we will consider this thread as solved by Wednesday and flag it accordingly.

      Cheers,
      Ferdinand

    • mfersaouiM

      Dynamic HandleInfo.direction

      Cinema 4D SDK
      • python • • mfersaoui
      6
      0
      Votes
      6
      Posts
      936
      Views

      ferdinandF

      Hello @mfersaoui,

      without any further questions or replies, we will consider this topic to be solved by Monday and flag it accordingly.

      Thank you for your understanding,
      Ferdinand

    • mfersaouiM

      Toggle bitmap button on .res file

      Cinema 4D SDK
      • python • • mfersaoui
      4
      0
      Votes
      4
      Posts
      747
      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

    • mfersaouiM

      Change the default name of ID_OBJECTPROPERTIES

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

      mfersaouiM

      @m_magalhaes said in Change the default name of ID_OBJECTPROPERTIES:

      DEFAULT 1;

      Thank you much.

    • mfersaouiM

      Best coding practices

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

      mfersaouiM

      @zipit Thank you much.

    • mfersaouiM

      Colorize plugin object icon

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

      M

      This functionality only exists since R21, for the previous versions, there is this hack that is very not recommended Plugins in plugin OR icons!!!!!.

      Cheers,
      Maxime.

    • mfersaouiM

      Check if the object parameters has been changed

      Cinema 4D SDK
      • python • • mfersaoui
      6
      0
      Votes
      6
      Posts
      916
      Views

      mfersaouiM

      Hi, Thank you @r_gigante, @zipit for your replies.

      The problem comes from the GetDDescription funtion because I use some of dynamic parameters on my objects.
      It is for this reason that op.IsDirty(c4d.DIRTY_DATA) returning True when I Move, Scale, Zoom or Rotate the perspective view.

    • mfersaouiM

      Create a download progress bar in python

      Cinema 4D SDK
      • python • • mfersaoui
      5
      0
      Votes
      5
      Posts
      1.1k
      Views

      M

      @indexofrefraction and just in case you have this example from CUSTOMGUI_PROGRESSBAR if you want a more minimal script.

      Cheers,
      Maxime.

    • mfersaouiM

      Apply a step value in SetHandle function

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

      mfersaouiM

      @zipit
      Hi,
      Thank you.

    • mfersaouiM

      Create a circle with specific area size.

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

      mfersaouiM

      @PluginStudent
      Thank you.

    • mfersaouiM

      Dynamic automated handle interface

      Cinema 4D SDK
      • python • • mfersaoui
      7
      0
      Votes
      7
      Posts
      1.0k
      Views

      ManuelM

      hi,

      I will mark this thread as solved tomorrow.

      Cheers,
      Manuel

    • mfersaouiM

      How to calculate a rectangle corners position depending on her rotation

      Cinema 4D SDK
      • c++ python • • mfersaoui
      6
      0
      Votes
      6
      Posts
      1.0k
      Views

      mfersaouiM

      @zipit
      Hi, Thank you so much.

    • mfersaouiM

      Recalculate Plugin Object Cache

      Cinema 4D SDK
      • python • • mfersaoui
      6
      0
      Votes
      6
      Posts
      832
      Views

      mfersaouiM

      Hi @r_gigante, @zipit,

      I'm creating something like the following code. I tried to use the GetAndCheckHierarchyClone, this works but the cloner object became to slow to calculate. For this reason I used the following solution:

      def __init__(self): pass #self.SetOptimizeCache(True) def GetVirtualObjects(self, op, hh): instance = op.GetDown() if instance is None: return c4d.BaseObject(c4d.Onull) dirty = op.CheckCache(hh) or op.IsDirty(c4d.DIRTY_DATA) instance_dirty = instance.IsDirty(c4d.DIRTY_DATA) dirty |= instance_dirty if not dirty: return op.GetCache(hh) cloner = c4d.BaseObject(c4d.Onull) count = 3 n = 0 while n < count: instance.GetCache().GetClone().InsertUnder(cloner) n += 1 cloner.Message(c4d.MSG_UPDATE) return cloner

      So, by just deactivating the SetOptimizeCache and cloning only the cache of the instance object the cloner object calculate is become to fast. The unique problem now is the cloner object is return the cache of previous modification on the instance object. This is perceptible only with bool parameters.
      Example:
      When I check a bool parameter of the instance object, the cloner return the result of the previous state of the bool parameter. but if I mouseover the cloner in the Viewport or I select it object manager this update the cloner object.

      Thanks

    • mfersaouiM

      Calculate the rounding radius max value of a n-Side object

      General Talk
      • c++ sdk • • mfersaoui
      3
      0
      Votes
      3
      Posts
      525
      Views

      mfersaouiM

      @Cairyn
      Hi,
      Thank you.

      Solution:

      Float GeIncircle(Int32 n, Float r) { return r * cos(PI / n); } Float max_rrad = GeIncircle(n, r);
    • mfersaouiM

      Formula to calculate cloner radius

      General Talk
      • c++ sdk • • mfersaoui
      3
      0
      Votes
      3
      Posts
      651
      Views

      mfersaouiM

      @r_gigante

      Hi Riccardo, thank you for your detailed response. That allowed me to find the exact formula.

      l / (2 * tan((180 / n) * 3.14159 / 180))

      Regards, Mustapha

    • mfersaouiM

      Applying a Target Expression tag to a child object of GVO

      Cinema 4D SDK
      • c++ sdk • • mfersaoui
      10
      0
      Votes
      10
      Posts
      1.4k
      Views

      mfersaouiM

      @m_magalhaes

      Hello, Thank you so much.

    • mfersaouiM

      Bend Deformer Using C++

      Cinema 4D SDK
      • c++ r19 sdk • • mfersaoui
      18
      0
      Votes
      18
      Posts
      2.7k
      Views

      M

      Yes because I've done it 🙂