Cannot set layer parameter for capsules in 2024.3.1
-
In 2024.3.1 python cannot set the layer parameter of a Capsule object. Other object types seem to be unaffected. Console shows the error: “AttributeError: parameter set failed”
Reproduction:
- Open Cinema 4D
- Add new layer in the Layer Manager
- Add a capsule object to the scene (e.g. Polygon Bevel)
- Run the script below in the Script Manager to set layer parameter for all objects
import c4d def main() -> None: # Get first layer myLayer = doc.GetLayerObjectRoot().GetDown() # Get objects in scene allObjects = doc.GetObjects() # Set layer attribute for objects in scene for i in range(len(allObjects)): allObjects[i][c4d.ID_LAYER_LINK] = myLayer c4d.EventAdd() if __name__ == '__main__': main()
Result
- The capsule layer is NOT set
- Error appears in console in the python tab
Versions
- [NOK] 2024.3.1
- [OK] 2024.2.0
Tested on:
- Windows 11 Pro (23H2)
- OSX Monterey 12.6.3
-
Very nice bug report, thank you for reading the guidelines. We will have a look on Monday
-
Hi thanks for the detailed report, I fixed the issue it be available in the next non-hotfix release.
As a workaround you can do
dId = c4d.DescID(c4d.ID_LAYER_LINK) allObjects[i][dId] = myLayer
Cheers,
Maxime.