2024.4 update makes CheckDirty error for ObjectData plugin Fieldlist
-
Hello there!
After updating to Cinema 4D 2024.4 my plugin causes this Exception:ReferenceError: the object 'c4d.modules.mograph.FieldLayer' is not alive The above exception was the direct cause of the following exception: SystemError: <function VTexterData.CheckDirty at 0x4b3546450> returned a result with an exception set
It happens after adding some fieldlayer to the Field List. What is problem it can be?
Here is my CheckDirty func:def get_field_layers(op): """ Returns all field layers that are referenced in a field list. Source: https://plugincafe.maxon.net/topic/11809/iterating-trough-field-list/2?_=1678357010902 """ def flatten_tree(node): """ Listifies a GeListNode tree. """ r = [] while node: r.append(node) for child in node.GetChildren(): r += flatten_tree(child) mask = node.GetMaskHead() if mask: for child in mask.GetChildren(): r += flatten_tree(child) node = node.GetNext() return r # get the GeListHead for the FieldList root = op.GetLayersRoot() if root is None: return [] # Get the first node under the GeListHead first = root.GetFirst() if first is None: return [] # traverse the graph return flatten_tree(first) def CheckDirty(self, op, doc): fdirty = 0 desc = op.GetDescription(c4d.DESCFLAGS_DESC_NONE) bc = desc.GetParameterI(c4d.VFTAG_TEXT_ANIMATOR_TRANSFORM, None) if not bc: return fenabled = [t[c4d.VFTAG_TEXT_ANIMATOR_ENABLE] for t in op.GetTags() if t.CheckType(c4d.Tvfanimatortag)] get_tvalue = lambda i: fenabled[i] if i < len(fenabled) else False #get correct value in case if tags count != axes count tfields = [op[c4d.VFTAG_TEXT_ANIMATOR_FIELDS + i] for i in range(len(bc[c4d.DESC_CYCLE])) if get_tvalue(i)] if not tfields: return for f in tfields: if not f or not f.HasContent(): continue fdirty += f.GetDirty(doc) for l in get_field_layers(f): if not l.IsAlive(): continue if l.GetTypeName() in ('Time','Decay','Delay') and l.GetStrength() > 0.0: fdirty += doc.GetTime().GetFrame(doc.GetFps()) continue fdirty += l.GetDirty(c4d.DIRTYFLAGS_ALL) lobject = l.GetLinkedObject(doc) if lobject: fdirty += lobject.GetDirty(c4d.DIRTYFLAGS_MATRIX | c4d.DIRTYFLAGS_DATA | c4d.DIRTYFLAGS_DESCRIPTION) fdirty += op.GetDirty(c4d.DIRTYFLAGS_MATRIX) if fdirty != self.lastFieldsDirty: self.lastFieldsDirty = fdirty op.SetDirty(c4d.DIRTYFLAGS_DATA)
-
Hey @mikeudin,
Thank you for reaching out to us and I am sorry for the inconvenience this has caused you. This error very likely means that there is a bug in our code as a node reference should not loose connection in this context. It would have been better if you have included line numbers in your stack trace, as without them I have to guess, but it seems very likely that the
return r
offlatten_tree
is the culprit with returning a dangling reference to aFieldLayer
, a 'not alive' node.While the code you have posted is sufficient for understanding the problem, we will need your full plugin code to debug the problem and possibly provide a temporary workaround before a fix arrives.
- Please send us your full plugin to
sdk_support(at)maxon(dot(net)
. - Please also provide an example scene which triggers the problem.
- Please also include a crash/bug report in the exact form lined out here.
- Finally, please make sure to provide us the unencrypted form of your plugin, or to give us explicit permission to decrypt it (we obviously prefer the former). We will have to look at your code and debug the actual plugin.
Cheers,
Ferdinand - Please send us your full plugin to
-
It would have been better if you have included line numbers in your stack trace, as without them I have to guess...
Error messages going not in traceback format
Here is a sample plugin with same issue.
odatafieldsexample.zip
-
Hey @mikeudin,
ah okay my bad, I thought you had a more expressive stack trace and just truncated it. We will have a look and keep you posted. Although I am fairly sure that this is a bug, we will wait with promoting/moving this topic to bugs until we have confirmed that it is a bug.
Cheers,
Ferdinandedit: I just looked into your zip. At least I do neither see there a scene file nor a bug report. Please provide these. When not, and we cannot reproduce an issue on first attempt without any instructions, we will simply declare it as "not reproducible". Even when you consider things obvious or trivial, you must provide reproduction steps and a scene.
-
Hi @mikeudin ,
To me it sounds pretty much like this issue here: issue with inserting fieldlayers in r2024, particularly after I couldn't reproduce this issue with the internally available next version of cinema.
Cheers,
Ilia