@ferdinand Thank you. hope this can be updated in the document
Posts
-
RE: how to detect obj selected in InExcludeData()?
-
RE: how to detect obj selected in InExcludeData()?
Hi @ferdinand , in .res file, how to set InExcludeData IN_EXCLUDE_FLAG_SEND_SELCHANGE_MSG is True? in c++ API doc,there no this flags for IN_EXCLUDE_FLAG_SEND_SELCHANGE_MSG
-
RE: how to detect obj selected in InExcludeData()?
Supplement an example of generating UserData using code:
import c4d def main() -> None: bc = c4d.GetCustomDataTypeDefault(c4d.CUSTOMDATATYPE_INEXCLUDE_LIST) bc[c4d.DESC_NAME] = "Test" bc[c4d.IN_EXCLUDE_FLAG_SEND_SELCHANGE_MSG] = True did = op.AddUserData(bc) c4d.EventAdd() if __name__ == '__main__': main() -
how to detect obj selected in InExcludeData()?
Hi,
i use this script code to detect obj selected in InExcludeData(),always return "None"import c4d doc: c4d.documents.BaseDocument # The currently active document. op: c4d.BaseObject | None # The primary selected object in `doc`. Can be `None`. def main() -> None: ie = op[c4d.ID_USERDATA,1] for i in range(ie.GetObjectCount()): print(ie.GetData(i)[c4d.IN_EXCLUDE_DATA_SELECTION]) if __name__ == '__main__': main()i found a example code in this post,but it also not work.
Thanks for any help!
-
RE: Viewport depth of field affects the content drawn using drawtexture()
@ferdinand Thanks for reply
Other channels(BOX,X-Ray....) also seem to be unfeasible, and currently it seems only can accept this limitation (affected by depth of field)
Due to the current not to transfer to C++, some plugin ideas are indeed somewhat unusual
only using some simple C4D drawings to generate Bitmaps, so I did not pay attention to the handling of Ocio. I will carefully read the manual on this aspect in the document. -
RE: Viewport depth of field affects the content drawn using drawtexture()
@ferdinand Thanks,
DRAWPASS::HANDLES There is a limitation that only displays when I select the object, and my goal is to keep it displayed (select or not select)
code:def Draw(self,op, drawpass, bd, bh): if drawpass == c4d.DRAWPASS_OBJECT: #draw bd.SetMatrix_Screen() window_dict = bd.GetSafeFrame() bd.SetLightList(c4d.BDRAW_SETLIGHTLIST_NOLIGHTS) # set uv ... info uvadr = [c4d.Vector(), c4d.Vector(), c4d.Vector(), c4d.Vector()] uvadr[1] = c4d.Vector(1, 0, 0) uvadr[2] = c4d.Vector(1, 1, 0) uvadr[3] = c4d.Vector(0, 1, 0) padr = [c4d.Vector(), c4d.Vector(), c4d.Vector(), c4d.Vector()] padr[0] = c4d.Vector(window_dict['cl'], window_dict['ct'], 0) padr[1] = c4d.Vector(window_dict['cr'], window_dict['ct'], 0) padr[2] = c4d.Vector(window_dict['cr'], window_dict['cb'], 0) padr[3] = c4d.Vector(window_dict['cl'], window_dict['cb'], 0) map = xx # this can be any images cadr = [c4d.Vector(1), c4d.Vector(1), c4d.Vector(1), c4d.Vector(1)] nadr = [c4d.Vector(1), c4d.Vector(1), c4d.Vector(1), c4d.Vector(1)] if map: bd.DrawTexture(map, padr, cadr, nadr, uvadr, 4, c4d.DRAW_ALPHA_NORMAL, c4d.DRAW_TEXTUREFLAGS_TEMPORARY) return c4d.DRAWRESULT_OK -
Viewport depth of field affects the content drawn using drawtexture()
hi,
I have a OBJECT_GENERATOR plugin and I encountered some problems while drawing it. I am drawing something in screen space use BaseDraw.DrawTexture(), and when I turn on depth of field of viewport, the drawn content is also affected. How to make the drawn content not affected by depth of field.
Thanks for any help! -
The value of 'progress' during the use of RenderDocument() is greater than 1.0
Hi,
I used the example code from c4d.documents.RendeDocument() in the document, which indicates that the values returned by progress are between 0-1.0. However, in my actual use, there may be some values greater than 1.0

This is my code, using Viewport Render with a frame range of 1001-1100
""" Copyright: MAXON Computer GmbH Author: Maxime Adam Description: - Render the current document with a progress hook to get notified about the current rendering progress. Class/method highlighted: - c4d.bitmaps.MultipassBitmap - c4d.documents.RenderDocument() """ import c4d def PythonCallBack(progress, progress_type): """Function passed in RenderDocument. It will be called automatically by Cinema 4D with the current render progress. Args: progress (float): The percent of the progress for the current step progress_type (c4d.RENDERPROGRESSTYPE): The Main part of the current rendering step """ print(progress) def main(): # Retrieves the current active render settings rd = doc.GetActiveRenderData() # Creates a Multi Pass Bitmaps that will store the render result bmp = c4d.bitmaps.MultipassBitmap(int(rd[c4d.RDATA_XRES]), int(rd[c4d.RDATA_YRES]), c4d.COLORMODE_RGB) if bmp is None: raise RuntimeError("Failed to create the bitmap.") # Adds an alpha channel bmp.AddChannel(True, True) # Renders the document if c4d.documents.RenderDocument(doc, rd.GetDataInstance(), bmp,c4d.RENDERFLAGS_EXTERNAL, prog=PythonCallBack, wprog=None) != c4d.RENDERRESULT_OK: raise RuntimeError("Failed to render the temporary document.") # Displays the render in the Picture Viewer #c4d.bitmaps.ShowBitmap(bmp) if __name__ == "__main__": main()Thanks for any help!
-
RE: How to obtain the object deformed by the deformer
@ferdinand Thanks for detailed explanation.
Let me introduce the goals that the custom deformer plugin wants to achieve. (As can be seen from the cube, cube. 1, cube. 2... in the image, each object has a weight tag.) The custom deformer plugin needs to preprocess and store some data before the ModifyObjects () function works. (By clicking a button) Access the weight tag of each object to be deformed in Message (), preprocess and store some data, and then use the preprocessed data to execute the ModifyObjects () function to correctly process the deformation calculation.

In C4D, it seems that the Surface deformer has achieved a similar function

(there are certain benefits to restricting the custom deformer plugin only to the parent level, as there is no need to spend effort on correctly linking the corresponding preprocessed data when the ModifyObjects () function works.But it did break the general logic operation of the deformer)
The only way you could do that is by checking each deformed object being passed into , to be the parent of the also passed in (i.e., the deformer also simply accessible via ). Only for an which is the parent of would you then carry out the modification.
-
RE: How to obtain the object deformed by the deformer
@ferdinand Thank you for your detailed reply.
If there is no direct method, it is a feasible solution to re implement the defoemer logic. However, since it requires storing data separately for each object that needs to be deformed, limiting the deformable device to only act on the parent object is a limited but more efficient method. -
How to obtain the object deformed by the deformer
Hi,
deformer object can deform an object in two ways:
method A as a child of the deformed object,
method B at the same level as the deformed object.There is a problem. In a custom deformer plugin, I obtain the deformed object in the Message() function. Using the first method A, I can obtain the deformed object ''Cube. x'' through node. GetUp(). but method B, how can I access the deformed object (Cube, Cube. 1, Cube. 2)?

Thanks for any help!
-
RE: pythonsdk doc Matrix manunl error?
@ferdinand Thank you for explanation. The point of confusion should be marked as 2 in the image. in doc the counterclockwise rotation (ccw) refers to the counterclockwise rotation from the spatial perspective of the image. but for the same rotation, the z-axis should have rotated clockwise(cw). However, in any case, the calculation is correct, only the description is different。
(Describing a rotation of an axis, it is assumed that a person looks in the negative direction from the positive direction of the axis, and based on this, counterclockwise and clockwise are defined) -
pythonsdk doc Matrix manunl error?
Hi,
When I read the matrix manual in python sdk doc, I found that the descriptions of 1 and 2 seem contradictory. In c4d, counter-clockwise rotation (ccw) displays a positive value 90 °, while clockwise rotation (cw) displays a negative value -90 °. However, in image marker 2, the transformation should be clockwise cw 90 ° (i.e. R.B=-90 °), not ccw90 °

-
RE: Frozen Matrix different
When I restart C4D, I cannot reproduce this problem. It's really confusing, c4d 2025.2.1
(And I also forgot to save the file at that time, resulting in the loss of the file on site) -
Frozen Matrix different
hi,
A parent object has 2 child objects whose global matrix are the same. They have the same frozen transform value, but the transform values are different. I used GetFrozenMln() to obtain the frozen matrix and found that the frozen matrix of the 2 child objects are *different.Why do 2 child objects have the same frozen transform value but different frozen matrix?

-
RE: Set RenderData framerate causing C4D to crash
@i_mazlov there is video, 2025.2.1,win11
-
Set RenderData framerate causing C4D to crash
Hi,
use bellow code will causing C4D to crashimport c4d doc: c4d.documents.BaseDocument # The currently active document. op: c4d.BaseObject | None # The primary selected object in `doc`. Can be `None`. def main() -> None: rd = c4d.documents.RenderData() rd[c4d.RDATA_FRAMERATE] = 2.0 if __name__ == '__main__': main()safe setting code:
rd = c4d.documents.RenderData() data = rd.GetDataInstance() data[c4d.c4d.RDATA_FRAMERATE] = 2.0bug?
