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. FSS
    3. Posts
    • Profile
    • Following 0
    • Followers 0
    • Topics 19
    • Posts 44
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by FSS

    • How do you collapse complex dependies in order?

      So, lets assume that a scene has complex dependancies.
      A generator depending on a splinewrapper, depending on a spline, depending on a oSweep, etc. etc.

      How do i succesfully collapse such constructs to editable poly in a python script? My approach would have been to make a dependancy tree and then navigate from the leafs inwards.

      But how do form that graph?

      I know about about

      objectInfo = obj.GetInfo()
      if objectInfo & c4d.OBJECT_INPUT:

      But i need to know which Object is the parent of that Input. Or preferably, if there is a existing solution a pointer to that?

      Or is there a sort of generic, generator dependency tree that can be traversed?

      Regards FSS

      posted in Cinema 4D SDK 2023 python
      FSSF
      FSS
    • RE: PyCharm Plugin on MacOs starts multiple Interpreter Instances

      Sorry, solved itself, the project path was not added to the jdk table file of pycharm. After that pycharm stopped doing this.

      <additional ASSOCIATED_PROJECT_PATH="$USER_HOME$/LocalProjects/your/project/folder" SDK_UUID="0c6c6d76-ff0d-40a3-b9de-d6146d25c014">
      <setting name="FLAVOR_ID" value="MacPythonSdkFlavor" />
      <setting name="FLAVOR_DATA" value="{}" />
      </additional>

      posted in General Talk
      FSSF
      FSS
    • PyCharm Plugin on MacOs starts multiple Interpreter Instances

      Hi everyone,

      hope you had nice holidays.
      im trying to follow the pyCharm setup, explained here and here:
      https://developers.maxon.net/docs/py/2023_2/manuals/introduction/autocompletion_dummy_package.html

      https://developers.maxon.net/forum/topic/10961/how-to-use-c4dpy-for-cinema4d-r20-sp1/4?_=1673858332967&lang=de

      The problem is, as soon as the Interpreter is called it seems to get stuck and start the interpreter over and over. Spamming my system with c4dpy instances in the background, with roughly a new one ever 3 minutes.

      Anyone experienced similar problems?

      posted in General Talk python project tool 2023
      FSSF
      FSS
    • How to detectflip normals of object inwardoutward?

      Hi everyone, hi ferdinand,

      simple question, is there a way to unify a objects normals (inward facing, outward facing) in code and flip them?

      I know about the OLathe FlipNormals Boolean, but found that these is not a reliable indictor for inwards or outwards facing normals.

      Is there a way to get the outwardness and inwarndness of normals (points majority towards pivot or away from pivot)..

      And is there a modifier (sorry for the 3ds max term) that flips all normals for editables.

      Merry XMas
      FSS

      posted in Cinema 4D SDK r23 python
      FSSF
      FSS
    • RE: Possible Bug when running in Commandline
      			LegionLib_Release.dll:	Legion::Mutex::lock + 0xc (SP: 0x000000379A5FF720, PC: 0x00007FFA368CF13C)
      			Corona4D.2023_Release.dll:	forcePluginDelayLoad + 0x1229cd (SP: 0x000000379A5FF750, PC: 0x00007FFA39D91F6D)
      			Corona4D.2023_Release.dll:	forcePluginDelayLoad + 0x1232fd (SP: 0x000000379A5FF7A0, PC: 0x00007FFA39D9289D)
      			Corona4D.2023_Release.dll:	forcePluginDelayLoad + 0x139f47 (SP: 0x000000379A5FF7D0, PC: 0x00007FFA39DA94E7)
      			LegionLib_Release.dll:	Legion::LowSystemMemoryChecker::`default constructor closure' + 0x90 (SP: 0x000000379A5FF870, PC: 0x00007FFA368F1CA0)
      			KERNEL32.DLL:	BaseThreadInitThunk + 0x14 (SP: 0x000000379A5FF8C0, PC: 0x00007FFAD5C674B4)
      			ntdll.dll:	RtlUserThreadStart + 0x21 (SP: 0x000000379A5FF8F0, PC: 0x00007FFAD6EC26A1)
      			Registers
      

      The counter part to the Mutex. Now looking into hot reloading the dll. If I dont return avenge me.

      posted in Cinema 4D SDK
      FSSF
      FSS
    • How to read a bugreport?

      Hi, i have a crash of the corona plugin and the resulting callstack in your bugreport. So after reporting it to Chaos, i decided to investigate the whole thing myself.

      Turns out the crash is during a FileRead for the Converter.logo in KernelLand in windows.
      Which should be easy to investigate with the

      GetLastError()

      if you have a minidump of the process. Which we have, thanks to bugreport not only consisting of x64 registers and stacktraces.

      https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfile

      So my question, were in the minidump attached to what dll is the error return value of the failed operation?

      I assume its in the process block of the dll, but without source i can only guess. So can i get the hexadress of the position in the dump that corresponds to the error number.

      To much coffee, to little sleep, so forgive the typos.

      Regards Florian Seidl-Schulz

      posted in Cinema 4D SDK r23 windows
      FSSF
      FSS
    • RE: Crash when converting objects in bulk

      Hi manuel, thanks for the quick reply.
      It seems thats the source of most of my probelms. I tried to solve it with preconversion, that picks out specific objects and applies a conversion strategy, but this will become lots of boiler plate busy work, though it may be worth it for performance reasons.
      Trying the isAliveApproach now.

      posted in Cinema 4D SDK
      FSSF
      FSS
    • RE: Crash when converting objects in bulk

      Same problem encountered with Ocasurface.

      posted in Cinema 4D SDK
      FSSF
      FSS
    • Crash when converting objects in bulk

      When converting objects in bulk, i run into a problem with R23.

      The Code in which it crashes:

      			for objectList in objectLists:
      				try:
      					commandCount += 1
      					
      					result = c4d.utils.SendModelingCommand( 
      						command = c4d.MCOMMAND_MAKEEDITABLE,##CMD.MAKE_EDITABLE
      						list = objectList,
      						mode = c4d.MODELINGCOMMANDMODE_ALL,
      						doc = doc,
      						flags = c4d.MODELINGCOMMANDFLAGS_CREATEUNDO # if this flag is not set the method will delete all affected objects from the list and return them
      					)
      
      					LogWithTimestamp(commandCount * objectsPerCommand, " items of ",len(allObjects)," made editable", LogLvl.DEBUG)
      etc.
      

      I add the crash report zipfile. I have no idea how to fix it, though it seems to be a kind of stackoverflow..

      _BugReport.zip

      I reduced the number of objects converte to narrow down what crashes the script. It blows up during the conversion of a Circular Object called "Kreis" which is a inner Object of a oSweep Object.

      [2022-11-17 17:11:36.519321] 8 items of 56 made editable
      [2022-11-17 17:11:36.529534] ObjectName:Kreis
      [2022-11-17 17:11:36.529534] ObjectName:Innenschirm
      [2022-11-17 17:11:36.539614] <c4d.documents.BaseDocument object called  with ID 110059 at 2240546111104>
      [2022-11-17 17:11:36.549779] [<c4d.SplineObject object called Kreis/Spline-Objekt with ID 5101 at 2240546107136>, <c4d.PolygonObject object called Innenschirm/Polygon-Objekt with ID 5100 at 2240546108160>]
      Traceback (most recent call last):
        File "C:\Program Files\Maxon Cinema 4D 2023\plugins\vuframe-aura-commandline.pyp", line 267, in ValidateModelSizeMakeEditable
          result = c4d.utils.SendModelingCommand(
      AssertionError: the passed document must match the object's document.
      
      During handling of the above exception, another exception occurred:
      

      I tried to work around the problem, by preconverting all oSweeps and oLathes, but even then once the script hit the circle Spline Object, it errored out in send Modelling command.

      If i convert a complex object, i guess i must clean up below.
      Still should just convert to a polygon circle then.

      Have a nice evening.

      posted in Cinema 4D SDK r23 python
      FSSF
      FSS
    • RE: Python Module not found on upgrade

      Thanks alot Ferdinand.

      I investigated some further and added the classes to the plugins list:

      _plugins = [
          "Tools",
          "Recipe",
      

      The error was also caused, by the executables having different libraries. Meaning, we call once cinema 4d.exe, which uses the {prefs}/python39/libs folder.

      The second part of the plugin is executed using the classic Commandline.exe and uses the {prefs}_x/python39/libs folder.

      Im a idiot, but a stubborn one.
      Have a great day.

      Topic can be locked now.

      posted in Cinema 4D SDK
      FSSF
      FSS
    • RE: Python Module not found on upgrade

      So, to answer my own question, seems that importing module components without module qualifiers does no longer work in 3.9?

      from Tools import LogWithTimestamp is wrong

      from VC4D.Tools import LogWithTimestamp is the correct way to go

      posted in Cinema 4D SDK
      FSSF
      FSS
    • Python Module not found on upgrade

      Hi everyone,

      im trying to upgrade our python module from R21(Python27) to the most recent cinema version 2023.1.0. BuildNumber (CL387487.470010)

      I followed the instructions on the website, https://developers.maxon.net/docs/py/2023_2/manuals/misc/python3_migration.html

      I copied the library-module to the following paths:

      c:\Users\tov\AppData\Roaming\Maxon\Maxon Cinema 4D 2023_BCDB4759_x\python39\libs\

      C:\Users\tov\AppData\Roaming\Maxon\Maxon Cinema 4D 2023_BCDB4759\python39\libs

      C:\Users\tov\AppData\Roaming\Maxon\python\python39\libs

      The library components are not found with the error message:

      Traceback (most recent call last):
        File "C:\Program Files\Maxon Cinema 4D 2023\plugins\vuframe-aura-commandline.pyp", line 31, in <module>
          import VC4D.Recipe as Recipe
        File "C:\Users\tov\AppData\Roaming\Maxon\Maxon Cinema 4D 2023_BCDB4759_x\python39\libs\VC4D\Recipe.py", line 11, in <module>
          from Tools import LogWithTimestamp
      ModuleNotFoundError: No module named 'Tools'
      

      The base plugin which uses the librarys resides in

      C:\Program Files\Maxon Cinema 4D 2023\plugins

      My module contains the usual suspects required:

      __init__.py
      __main__.py
      _version.py
      

      What did i miss?
      Is it required to add a special Path to the systemvariables?

      posted in Cinema 4D SDK
      FSSF
      FSS
    • Floating license problem

      Hello everyone,
      i think i have a problem with the floating license model.

      https://support.maxon.net/hc/en-us/articles/4409883337874-Floating-licenses-in-Maxon-App

      In particular it seems that in this license state machine, there is no state dedicated to what happens to licenses, when programs execution aborts suddenly or connection is lost. Is there a collection mode, were i can start releasing licenses from a pool that are currently not in use? Or a time-out were a license returns to pool after n minutes?

      I had to release licenses from defunct instances manually which sort of defeats the whole purpose of automation & scripting.
      Is there a way to have a "always on" program on the running maschine, to auto-release the license, should it loose connection or time out?

      posted in General Talk
      FSSF
      FSS
    • RE: I have a problem converting a Osweep object to editable.

      Im sorry, i can not send you the customer files. As soon as the team has any time, we will reproduce the test case in a seperate 3d file and send it with the code-sample.

      posted in Cinema 4D SDK
      FSSF
      FSS
    • RE: I have a problem converting a Osweep object to editable.

      @ferdinand Thanks for your reply Ferdinand.

      3fe3a3c6-07fa-4e0d-a79f-79cad4238144-grafik.png

      One converted out example looks like this, having no resemblance to the original object which was a cable in a spiral. Some other examples exist, were the spiral is sqashed into a eardrum like shape.

      It seems the spiral modifier data structure (which should be a sinus applied over a 3dimensional circle ) is squashed into a 2dimensional concept. You can even see a second sinus multiplied in at the end.

      I shall try to use the Modelcommand recommend by you. Sorry for the slow replying.

      posted in Cinema 4D SDK
      FSSF
      FSS
    • I have a problem converting a Osweep object to editable.

      The object will be converted, but will be turned into a sinusoid polygon editable.

      Used command:

      MAKE_EDITABLE = 12236
      
      doc.SetActiveObject(obj)
      c4d.CallCommand(MAKE_EDITABLE)
      

      I exported the scene pre and post operation and it is actually this command producing the result.

      The sweep Object is a pretty standard cable with diameter and a spline to trace.

      Thx to all of you for reading and helping. Pretty great comunity.

      posted in Cinema 4D SDK r21 python
      FSSF
      FSS
    • RE: Handling Windows Paths with a Umlaut in Python - Ä.

      Eh, this was the first approach i tried, it will map the decoded utf-8 to Windows codepage 1252. (Sorry about the wrong one in the code above). I tried to change the system setting to utf8 but it would not accpet that. Thanks for your help, Maxime

      posted in Cinema 4D SDK
      FSSF
      FSS
    • RE: Get the preview images from c4d files

      https://forums.cgsociety.org/t/set-preview-in-content-browser-via-python-script/2056787

      Not certain it solves your problem but in this post somebody changed the preview picture in python.

      https://developers.maxon.net/forum/topic/7666/9673_set-document-preview/2

      posted in Cinema 4D SDK
      FSSF
      FSS
    • RE: Possible Bug when running in Commandline

      Thanks for explaining Manual

      posted in Cinema 4D SDK
      FSSF
      FSS
    • Handling Windows Paths with a Umlaut in Python - Ä.

      Hi, i encountered a problem using paths containining Umlauts in my code. Im trying to rename Customer Texture files which have Umlauts in there names.

      I traverse the folder, glue the filenames together which does not produce any error.

      originalFilePathAsciiiUTF8Mix = os.path.join(srcFolder, 'tex', originalFileName)
      

      However when i try to use the concated path, with file.open or shutil.copy2 the path is not found and the displayed path in the error message seems to be a strange mixture of properly escaped ascii symbols and not escaped UTF8 elements.

      I printed out the path as hexValues and the values look like a classic ascii (no codepage) string (not clear on what codepage) and raw UTF8 Values in the middle.

      Example:

      originalFilePathAsciiLatin1 -> |C=43|:=3a|\=5c|T=54|e=65|s=73|t=74|\=5c|I=49|n=6e|p=70|u=75|t=74|\=5c|4=34|3=33|4=34|6=36|9=39|\=5c|4=34|3=33|4=34|6=36|9=39|\=5c|t=74|e=65|x=78|\=5c|k=6b|i=69|e=65|f=66|e=65|r=72|_=5f|g=67|e=65|f=66|l=6c|=c3|=a4|m=6d|m=6d|t=74|_=5f|1=31|.=2e|j=6a|p=70|e=65|g=67
      

      So ive read into encodings and utf8 in Python 2.7 and boy, what a rabbit hole.
      My question is, how can i convert this "hybrid" into a valid utf8 representation and finally into a path that the services used by shutil and os.copy can handle.

      originalFilePath = originalFilePathAsciiiUTF8Mix.decode('utf-8').encode('cp1250')
      os.copy(originalFilePath, sanitizedFilePathName)
      
      posted in Cinema 4D SDK r21 python
      FSSF
      FSS