@ferdinand Okay, I will handle the plugins and files at an appropriate time.Thanks reply
Posts
-
RE: MergeDocument() crash C4D
-
RE: Using SetWeightMap() multiple times can lead to inexplicable changes in weight values
@ferdinand Thanks for your detailed explanation.
Although the precision conversion leading to value changes is not an error, it is indeed not what we want in terms of the results. For example, when dealing with the weight of some points, using SetWeightMap() will update the weights of other points, resulting in numerical changes. Only using SetWeight() can at least ensure that the weights of unoperated points do not undergo numerical changes (but using SetWeight() must tolerate the print warnings outputted by the console) -
RE: MergeDocument() crash C4D
@ferdinand Thanks for your detailed explanation.
-
RE: MergeDocument() crash C4D
@ferdinand Thanks for reply.
I tested a simple C4D file (such as one with only a cube, where the merge command works well).
But I still have a question. If it's a plugin issue ( CopyTo Read Write function is not implemented), then why can the Merge command in C4D merge files normally?(As an aside, I found this issue in one of my plugins (which uses MergeDocument). This plugin was developed in C4D 2024, and the same code worked in older versions but crashes in 2026. Even with the same script code and merge same file, it works normally in 2024 but crashes in 2026)
c4d.documents.MergeDocument(doc, path_str,c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS,c4d.threading.GeGetCurrentThread()) -
RE: Using SetWeightMap() multiple times can lead to inexplicable changes in weight values
@ferdinand Hi,
I used your file for the demonstration. (Opening your file and running the code directly not cause any issues.)
The problem occurred after smooth weights. In the demonstration, only the smoothing operation of weights was performed. Running the code again, you can see the change in the weight values
-
RE: MergeDocument() crash C4D
@Anlv Thanks for your reply.can't reproduce this issue on your side, it seems I need to test it on other computers. It's a puzzling problem
-
RE: MergeDocument() crash C4D
@Anlv Hi
Here is a video demonstrating how C4D crashes. For a saved document (or a loaded document), using MergeDocument() is fine, but for a new document that hasn't been saved, using MergeDocument() will definitely crash
2026.3.3 win11
-
MergeDocument() crash C4D
Hi,
c4d.documents.MergeDocument(doc, path_str,c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS,None)this code,c4d always crashed
-
RE: Using SetWeightMap() multiple times can lead to inexplicable changes in weight values
@ferdinand
Hi,The simple demo I made:
1:Create a standard cube (with 8 vertices),
2:Create 8 joint (point_id 1 -> joint 1 ),bind it,then offset all joints (x:10000,y:10000,z:10000 cm)
3:Each point is 100% bound to a bone,
4: Then, apply smooth 1-2 times to all bones and points to obtain a result where each point is influenced by all bones (facilitating the observation of the code execution results)
5: normalize weights
6:Then execute the code 2-3 times, and you can clearly see the resultcode:
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: tag = op.GetTag(c4d.Tweights) if not tag: return j_cnt = tag.GetJointCount() p_cnt = op.GetPointCount() for i in range(10): weights = [tag.GetWeightMap(j_id,p_cnt) for j_id in range(j_cnt)] for j_id in range(j_cnt): tag.SetWeightMap(j_id,weights[j_id]) tag.WeightDirty() c4d.EventAdd() if __name__ == '__main__': main()
video:
-
Using SetWeightMap() multiple times can lead to inexplicable changes in weight values
Hi,
Previously, I had been using the SetWeight() method to set weight values, and it worked very stably. However, after seeing the deprecation notice for SetWeight() in the python api documentation, I switched to using SetWeightMap() instead. However, there were some issues with this function. When I used SetWeightMap() multiple times to set values, its values would gradually change.Below is a simple example of my video, using a standard cube (with 8 points), where each point is equally influenced by all bones.
However, when I repeatedly obtain the weight values using GetWeightMap()without making any changes, and then set the weights using SetWeightMap() again, I can see that the weight values have undergone slight changes, with the sum of weights changing from 1 --> 0.998
-
RE: After calling BaseContainer.Sort(), the stored values are lost
@ferdinand Thanks for your detailed explanation and the implementation of the sorting function. It's very helpful!
-
After calling BaseContainer.Sort(), the stored values are lost
Hi,
My requirement is to rearrange the basecontainer in order of id, so I used the BaseContainer().Sort() function. However, there were two issues in the simple test:- the stored values were lost
- it was not arranged in order of id
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: bc = c4d.BaseContainer() for i in range(4,12): bc.SetInt32(i,i) for i in range(3): bc.SetInt32(i,i) for id,v in bc: print(id,v) print("--------") bc.Sort() for id,v in bc: print(id,v) if __name__ == '__main__': main()Did I misunderstand this function?
-
TimeLine DopeSheet not update
Hi
in Dope Sheet -F-Curve mode,i change CTrack NBit(c4d.NBIT_TL1_SELECT2) ,(selection State),the window will not refresh immediately.After selection state change, how can I make the window refresh in real time
import c4d def main() -> None: for track in op.GetCTracks(): track.ChangeNBit(c4d.NBIT_TL1_SELECT2,c4d.NBITCONTROL_SET) c4d.EventAdd() if __name__ == '__main__': main()Thanks for any help!
-
RE: how to detect obj selected in InExcludeData()?
@ferdinand Thank you. hope this can be updated in the document

-
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.