How to handle AddDependence hh deprecation in 2024 onwards
-
I have an ObjectPlugin written in Python.
It implements def GetVirtualObjects(self, op, hierarchyhelp)
Inside I am calling AddDependence
The following code produces an warning in 2024 and 2025: PendingDeprecationWarning: The 'hh' argument is not used since 2024.0 and will be removed in 2025.0. Since it is happening in GetVirtualObjects this error gets printed out 100's of thousands of times currently, leading to an eventual lockup.
for obj in ObjList: op.AddDependence(hierarchyhelp, obj)
It seems that I can't simply remove hierarchyhelp since that causes another error.
I can't seem to find any documentation on this other than to say that hh is deprecated, but no additional info saying what we should do to fix it. Since the help docs still contain hierarchyhelp as the first input to the method.
Thanks,
Kent -
Hi @kbar sadly there is no way to suppress this warning, I removed the hh argument for the next version, thanks for the reminder.
Cheers,
Maxime. -
@m_adam that is unfortunate.
-
Hey @kbar,
I hope you are well! Since I just answered a similar question in another topic, I am also answering here. We never make any guarantees regarding when something will be released in SDKs. And more-over, we never name upcoming Cinema 4D versions explicitly or when they will arrive. This also includes seemingly insignificant information such as if the next version will be a minor or a major version increment.
Please note that you as Maxon Registered Developer are bound by an NDA and also cannot disclose such information to the public.
But yes, I am pretty sure Maxime meant the next upcoming release.
Cheers,
Ferdinand -
@ferdinand Looks like the issue I outlined above has been fixed in 2025.2.0 which is great. Thank you for that.
It looks like we now need to remove that parameter from the Python documentation since it still has the parameter and my code only now seems to work if I remove hh
BaseObject.AddDependence(self, hh, op, dirtyflags=DIRTYFLAGS_DATA | DIRTYFLAGS_MATRIX)
Should be
BaseObject.AddDependence(self, op, dirtyflags=DIRTYFLAGS_DATA | DIRTYFLAGS_MATRIX)
Which is a breaking change for any plugin that relies on GetVirtualObjects and touching dependent objects to hide them from being rendered in the scene.
-
Hey @kbar,
Thank you for reaching out to us and the heads up, much appreciated. Looks like we forgot to update the function documentation, because the change is in the change notes. I updated the docs for the upcoming release.
Cheers,
Ferdinand