• Export objects with materials to new document

    Cinema 4D SDK python r19
    2
    0 Votes
    2 Posts
    504 Views
    A
    Found it! c4d.documents.IsolateObjects(doc, t_objects) A helper routine to copy the objects t_objects of document doc to a new document (returned). All materials associated are also copied over and the links are corrected. Parameters: doc (c4d.documents.BaseDocument) – The document that contains the objects in t_objects. t_objects (List[c4d.BaseObject]) – The objects to isolate. Return type: c4d.documents.BaseDocument Returns: The document containing the isolated objects. Thank you all !
  • 1 Votes
    3 Posts
    1k Views
    J
    @m_adam Thank you very much ! it is certainly helpful !!
  • Get current frame at render time with Python?

    Cinema 4D SDK
    3
    0 Votes
    3 Posts
    776 Views
    A
    Hi Maxime, thanks for the response! I was aware that the scene gets copied, but unaware of the GetDocument function so it definitely makes sense! I will give that a try and report back. I have been trying this with both a python effector, as well as in a python xpresso node. Andrew
  • 0 Votes
    5 Posts
    3k Views
    ManuelM
    hello, thanks @tummosoft, it's nice to see it's helpful @ilad By the way instead of ID_BASEOBJECT_POSITION you could have use ID_BASEOBJECT_REL_POSITION. Both Ids are the same. If you want to know how to get those ids you can use the python console and drag and drop parameters, more information on this page In this case the DescID is composed of two DescLevel. The first define the Vector type, the second de Float type for X, Y and Z. (DescID can have less or more levels) To change the Size.Y of the cube, the descID will be : c4d.DescID(c4d.DescLevel(c4d.PRIM_CUBE_LEN, c4d.DTYPE_VECTOR, 0), c4d.DescLevel(c4d.VECTOR_Y, c4d.DTYPE_REAL, 0))) To change the scale of the object the descID will be : c4d.DescID(c4d.DescLevel(c4d.ID_BASEOBJECT_REL_SCALE, c4d.DTYPE_VECTOR, 0), c4d.DescLevel(c4d.VECTOR_Y, c4d.DTYPE_REAL, 0))) Cheers Manuel
  • Search Icon in Menubar

    Cinema 4D SDK
    3
    1
    0 Votes
    3 Posts
    578 Views
    lasselauchL
    Wow, thanks so much for this complete Example, Maxime..!!! Great work, really appreciated! Cheers, Lasse
  • Highlighted Command Text/Icon when it is executed?

    Cinema 4D SDK r20 python
    7
    0 Votes
    7 Posts
    887 Views
    B
    Thank you @m_adam. Work as expected! (I actually just ended up learning about the decorator property since its new to me. haha. Thanks for that). Just want to confirm, am I right to think this is the code flow: Register Plug-In @property state GetState Execute(Button Click) @state.setter state @property state GetState Then back again to #4 for the click.
  • 0 Votes
    5 Posts
    1k Views
    I
    @r_gigante Thank for your professional help! I am so grateful for your commitment!
  • DrawHUDText returns a white box instead of a text?

    Cinema 4D SDK r20 python
    19
    0 Votes
    19 Posts
    4k Views
    M
    Regarding the Z setting of DrawHUDText (I'm not sure about which one to be honest since there is no Z param for this method) previously the fact that HUD was behind poly object was a limitation regarding how our draw call was done by the viewport, but this is addressed in S22 and its the expected result that a HUD text is not overridden by any other objects but act as a HUD and to be draw in front of everything. Cheers, Maxime.
  • Dynamic Update on Plug-ins

    Cinema 4D SDK r20 python
    5
    0 Votes
    5 Posts
    683 Views
    B
    Hi @m_magalhaes Thanks for the response and clarification specially with the def __init___ and def InitValuesthat was news to me. The plug-in works as expected. Have a great day ahead!
  • controlled rendering programmatically

    Cinema 4D SDK sdk python
    3
    0 Votes
    3 Posts
    679 Views
    ManuelM
    hi, without any further feedback, this thread will be considered as solve tomorrow. Cheers Manuel
  • 0 Votes
    8 Posts
    1k Views
    ManuelM
    hi, without any further feedback, this thread will be considered as solve tomorrow. Cheers Manuel
  • Sperical floor issue

    Cinema 4D SDK sdk c++ python
    3
    0 Votes
    3 Posts
    655 Views
    ManuelM
    hi, without any further feedback, this thread will be considered as solve tomorrow. Cheers Manuel
  • 0 Votes
    5 Posts
    736 Views
    M
    @mfersaoui said in Automatically add effector object into In-/Exclusion User Data: @m_adam Thank you, Now I'm searching for how to add an Object to an In-Exclude user data. I tried with the following code but this doesn't work. import c4d def main(): effectors = op[c4d.ID_USERDATA,2] # In/Exclude User Data plain = doc.GetFirstObject() # Plain object (Effector) effectors.InsertObject(plain, 1) c4d.EventAdd() if __name__=='__main__': main() The actual issue is that effectors = op[c4d.ID_USERDATA,2] perform a copy of the InExcludeData so that means you have to reassign the data correctly after it since you don't do the change directly from the InExcludeData of the BaseContainer. op[c4d.ID_USERDATA,2] = effector Cheers, Maxime.
  • urllib2.HTTPError: HTTP Error 403

    Cinema 4D SDK python
    4
    0 Votes
    4 Posts
    1k Views
    ManuelM
    hello, we did run a couple of test and seems that the "issue" is on Patreon side. HTTP Error 403: Forbidden We did try with other url, it work. We did try adding header-agent or things like that, it failed. They probably changed something on their server that doesn't allow to connect with python with default parameters. You have to contact them in order to know what you have to do. Cheers Manuel
  • 0 Votes
    3 Posts
    473 Views
    chuanzhenC
    @m_adam Thanks
  • Creating shaders from PSD files

    Cinema 4D SDK python
    11
    1
    0 Votes
    11 Posts
    3k 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
  • GvNode parameters

    Cinema 4D SDK python
    5
    0 Votes
    5 Posts
    1k Views
    ManuelM
    hello, I've got some feedback, You can't rely on the fact that all resource name contain Redshift. (most but not all). As Some parts are generated dynamically this could break your tools. May I ask you what are you trying to implement ? Cheers Manuel
  • GeGetModata inside Python Generator returns none

    Cinema 4D SDK r20 python
    3
    0 Votes
    3 Posts
    806 Views
    P
    to be honest - i don't know where my fault was. Unhappily i didn't commit the not working version. In my plugin i already used a virtual doc for some other calculations. thank you! vd.ExecutePasses(c4d.threading.GeGetCurrentThread(), True, True, True, c4d.BUILDFLAGS_NONE) md = c4d.modules.mograph.GeGetMoData(matrix) for m in md.GetArray(c4d.MODATA_MATRIX): rdPoints.append(m.off) works like a sharm.
  • How to close a dialog box by event

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    730 Views
    V
    That should work. Thanks for the clarification and pointer to the example!