• Creating shaders from PSD files

    python
    11
    1
    0 Votes
    11 Posts
    2k Views
    M
    Hi Been a few years now, any changes on this, I would love a script that iterated through a PSD file, create a material for each layer and set the Alphas for each layer
  • R21 c4dpy LoadFile always return False

    sdk python
    6
    2
    0 Votes
    6 Posts
    759 Views
    S
    @ferdinand wow, awesome. It works! thank you so much.
  • Object size not updated after points move

    python r25
    3
    0 Votes
    3 Posts
    693 Views
    P
    Well, that indeed fixed the issue, now the size gets properly updated! Thank you very much for the help
  • 0 Votes
    11 Posts
    2k Views
    ferdinandF
    Hello @pyxelrigger, without any further activity before Wednesday, the 16.03.2022, we will consider this topic as solved and remove the "unsolved" state from this topic. Thank you for your understanding, Ferdinand
  • Test "Lock Overrides" in Python

    python
    4
    0 Votes
    4 Posts
    694 Views
    ferdinandF
    Hello @danielsian, without any further activity before Wednesday, the 16.03.2022, we will consider this topic as solved and remove the "unsolved" state from this topic. Thank you for your understanding, Ferdinand
  • Strip Texture Path using Python

    python
    5
    0 Votes
    5 Posts
    927 Views
    ferdinandF
    Hello @djoneeeee, without any further activity before Wednesday, the 16.03.2022, we will consider this topic as solved and remove the "unsolved" state from this topic. Thank you for your understanding, Ferdinand
  • The second "call command" cannot be executed

    python s24
    6
    0 Votes
    6 Posts
    997 Views
    ferdinandF
    Hello @mari, without any further activity before Wednesday, the 16.03.2022, we will consider this topic as solved and remove the "unsolved" state from this topic. Thank you for your understanding, Ferdinand
  • Normal tangents to world

    7
    0 Votes
    7 Posts
    1k Views
    ferdinandF
    Hello @wickedp, without any further activity before Wednesday, the 16.03.2022, we will consider this topic as solved and remove the "unsolved" state from this topic. Thank you for your understanding, Ferdinand
  • Calling an existing user data preset onto a python tag.

    python r25
    7
    0 Votes
    7 Posts
    1k Views
    ferdinandF
    Hello @z-prich, without any further activity before Wednesday, the 16.03.2022, we will consider this topic as solved and remove the "unsolved" state of this topic. Thank you for your understanding, Ferdinand
  • Is it possible to add layer solo to a new take through script?

    python
    4
    1
    0 Votes
    4 Posts
    648 Views
    ferdinandF
    Hello @sean1832 , without any further activity before Wednesday, the 16.03.2022, we will consider this topic as solved and remove the "unsolved" state of this topic. Thank you for your understanding, Ferdinand
  • What are the AES specifications for the AES encryption in C4D SDK ?

    c++
    7
    0 Votes
    7 Posts
    995 Views
    ferdinandF
    Hello @c5d, without any further activity before Wednesday, the 16.03.2022, we will consider this topic as solved and remove the "unsolved" state of this topic. Thank you for your understanding, Ferdinand
  • Python Source Protector: Can it be called via CLI?

    python
    18
    0 Votes
    18 Posts
    4k Views
    a_blockA
    Thanks, Ferdinand! Much appreciated. I always forget about c4dpy and that it can still be run in parallel to a running C4D instance. Thanks.
  • Symbol not found: ___chkstk_darwin

    r23 python c++
    2
    1
    0 Votes
    2 Posts
    555 Views
    M
    Cinema 4D R23 require at least mac os 10.14 and the most optimal is 10.15. In your case you need to update to 10.15. See Cinema 4D R23 Requierements. Cheers, Maxime.
  • Layers checker

    python s24 sdk
    4
    0 Votes
    4 Posts
    1k Views
    ROMANR
    @mogh I didn't know about this function @ferdinand Thank you a lot for your detailed response. I will chek posts which you recommended
  • OpenGL in Cinema 4D

    python r25
    6
    0 Votes
    6 Posts
    2k Views
    gheyretG
    @fwilleke80 Yes, it's a solution. But it's can not to orbiting the scene or transforming the model. I think i need to make a desktop application, and make sure the window always on top. However, this will lead to more work for me. And thanks to your reply! cheers
  • Particles from python SDK

    5
    0 Votes
    5 Posts
    999 Views
    Z
    @ferdinand That is great! I did not imagine that working so simply, that's a wonderful feature. Regarding the 'broken' part, I did 'something' and spheres stopped appearing in the viewport, just the 'tracers'. I cannot reproduce that, I must have screwed up. All is right with the world now. In case it helps others, the demo code below now does everything I currently need. Programmatically changes position of the emitter, and following this discussion (https://forums.cgsociety.org/t/c4d-animation-via-python/1546556) I also change the color over the course of each 10-frame segment. Thanks so much for your help, I am really sold on 4D. import c4d import math import random mat = c4d.BaseMaterial(c4d.Mmaterial) mat.SetName('emitter sphere') mat[c4d.MATERIAL_COLOR_COLOR] = c4d.Vector(0.8, 0.0, 0.0) ## Get RGB tracks for continuous color update redtrack = c4d.CTrack(mat, c4d.DescID(c4d.DescLevel(c4d.MATERIAL_COLOR_COLOR, c4d.DTYPE_COLOR, 0, ), c4d.DescLevel(c4d.VECTOR_X, c4d.DTYPE_REAL, 0))) mat.InsertTrackSorted(redtrack) greentrack = c4d.CTrack(mat, c4d.DescID(c4d.DescLevel(c4d.MATERIAL_COLOR_COLOR, c4d.DTYPE_COLOR, 0, ), c4d.DescLevel(c4d.VECTOR_Y, c4d.DTYPE_REAL, 0))) mat.InsertTrackSorted(greentrack) bluetrack = c4d.CTrack(mat, c4d.DescID(c4d.DescLevel(c4d.MATERIAL_COLOR_COLOR, c4d.DTYPE_COLOR, 0, ), c4d.DescLevel(c4d.VECTOR_Z, c4d.DTYPE_REAL, 0))) mat.InsertTrackSorted(bluetrack) doc.InsertMaterial(mat) sph = c4d.BaseObject(5160) rad = sph.GetRad() particleRad = 2.0 scale = particleRad/rad[0] sph.SetAbsScale((scale,scale,scale)) ttag = c4d.TextureTag() ttag.SetMaterial(mat) sph.InsertTag(ttag) sph.SetBit(c4d.BIT_ACTIVE) emitter = c4d.BaseObject(5109) emitter.SetBit(c4d.BIT_ACTIVE) doc.InsertObject(emitter) sph.InsertUnder(emitter) # emit particles at rate 500 emitter[c4d.PARTICLEOBJECT_BIRTHEDITOR] = 500 emitter[c4d.PARTICLEOBJECT_BIRTHRAYTRACER ] = 500 emitter[c4d.PARTICLEOBJECT_RENDERINSTANCES] = 500 emitter[c4d.PARTICLEOBJECT_SIZEX] = 0.2 emitter[c4d.PARTICLEOBJECT_SIZEY] = 0.2 emitter[c4d.PARTICLEOBJECT_TYPE] = c4d.PARTICLEOBJECT_TYPE_PYRAMID emitter[c4d.PARTICLEOBJECT_ANGLEH] = 2 * math.pi emitter[c4d.PARTICLEOBJECT_ANGLEV] = math.pi emitter[c4d.PARTICLEOBJECT_SHOWOBJECTS] = True fps = 24 emitter[c4d.PARTICLEOBJECT_START] = c4d.BaseTime(0, fps) emitter[c4d.PARTICLEOBJECT_STOP] = c4d.BaseTime(500, fps) emitter[c4d.PARTICLEOBJECT_LIFETIME] = c4d.BaseTime(5, fps) ## Animate 500 frames, new position every ten frames, ## transition to next color (cycle red->green->blue) ## First set key frames for color change nextRGB = [1.,0.,0.] redcurve = redtrack.GetCurve() greencurve = greentrack.GetCurve() bluecurve = bluetrack.GetCurve() for segment in range(50) : frame = 50*segment redkey = redcurve.AddKey(c4d.BaseTime(frame, fps))['key'] redkey.SetValue(redcurve, nextRGB[0]) greenkey = greencurve.AddKey(c4d.BaseTime(frame, fps))['key'] greenkey.SetValue(greencurve, nextRGB[1]) bluekey = bluecurve.AddKey(c4d.BaseTime(frame, fps))['key'] bluekey.SetValue(bluecurve, nextRGB[2]) # # rotate RGB values nextRGB.append(nextRGB.pop(0)) ## run animation frame = 0 pos = c4d.Vector(0,0,0) emitter.SetAbsPos(pos) doc.SetTime(c4d.BaseTime(frame, fps)) c4d.CallCommand(12410) for segment in range(50) : frame = 10 * segment mat.Update(True, True) sph.Message(c4d.MSG_UPDATE) for k in range(3) : pos[k] = -30 + 60*random.random() emitter.SetAbsPos(pos) doc.SetTime(c4d.BaseTime(frame, fps)) c4d.CallCommand(12410) # record
  • module 'c4d' has no attribute 'ASSETDATA_FLAG_MISSING'

    r23 r25 python
    3
    0 Votes
    3 Posts
    598 Views
    mikeudinM
    @cairyn Thank you!
  • Thinking Particles in ParallelFor

    r20 c++ windows sdk
    5
    0 Votes
    5 Posts
    961 Views
    N
    Hello @ferdinand, thank you again for this very detailed and helpful reply! I tried both methods, allocating beforehand and like the previous setup, just have it after the ParallelFor altogether. Both worked, although allocating beforehand introduced some weird flickering in the particles and was (at least it feels that way) more unstable. Which is why I opted to go for the second solution as with some exstensive testing it didn't seem to cause any issues. For anyone maybe reading this in the future and having the same issues: Do not allocate the particle group inside the plugin but use a link field and have the user handle the particle group creation inside c4d, that solved a lot of weird behaviours and seemed to work better/more stable. (at least in my not so intended usecase) I will mark this thread as solved, as it works now and I can fix the main-thread issue as well without too much trouble. So thank you very much for your quick and very detailed replies! Best Regards, Florian
  • Treeview Column adjust

    python r20 r25
    8
    2
    0 Votes
    8 Posts
    2k Views
    ferdinandF
    Hey @mogh, Thank you for the kind words and I am happy that this solved your problem. While I sometimes channel here my inner librarian and press for a formal order for new topics, so that the SDK Team can answer them effectively, I want to make clear that all Cinema 4D programming questions are welcome on Plugin Café. Just remember to open a new topic for new questions and to place them in the General Talk forum when they are general programming questions not directly related to our APIs. We will treat them then with a lower priority and rigor, but we usually also answer there. Cheers, Ferdinand
  • Resolving Save Path in Render Settings

    python
    3
    0 Votes
    3 Posts
    493 Views
    a_blockA
    Hi Ferdinand, thanks for your thorough and detailed reply. The problem is, I need to put the correct name of the rendered output into a text file. This needs to match, when rendered later on. So, just guessing something similar is also not an option. I already anticipated, there would be no easy solution. By the way, even if I had the time to test render 1x1 images, it would still not be ok, there are resolution tokens... I will most likely reduce the amount of freedom the user has here, in order to end with something deterministic. Thanks for your help and ideas. You can consider this topic closed from my side. Cheers to the entire SDK Team, Andreas