Page MenuHome

fixes call of create_derived_objects() in x3d export in v. 3.0
ClosedPublic

Authored by Andreas Plesch (andreasplesch) on Dec 25 2021, 6:01 AM.

Details

Summary

v. 3.0 introduced a change in the signature and return value of the create_derived_objects() utility. This change lead to failure of the x3d export addon:
see https://developer.blender.org/T94122
This small patch adapts how the function is called in the io_scene_x3d addon and extracts the needed value from the return.

Diff Detail

Event Timeline

Andreas Plesch (andreasplesch) requested review of this revision.Dec 25 2021, 6:01 AM
Andreas Plesch (andreasplesch) created this revision.

Apologies for the camelCase in derivedDict which slipped into the patch. I edited the patch to use derived_dict.

LGTM, @Andreas Plesch (andreasplesch) can you please update the patch with proper paths though? Otherwise cannot apply with arch, which makes it harder to properly credit you as author in the commit.

E.g.:

diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index 746567f8..6a4daf91 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -1378,7 +1378,8 @@ def export(file,
     def export_object(ident, obj_main_parent, obj_main, obj_children):
         matrix_fallback = mathutils.Matrix()
         world = scene.world
-        free, derived = create_derived_objects(scene, obj_main)
+        derived_dict = create_derived_objects(depsgraph, [obj_main])
+        derived = derived_dict.get(obj_main)
 
         if use_hierarchy:
             obj_main_matrix_world = obj_main.matrix_world
This revision is now accepted and ready to land.Dec 27 2021, 11:23 AM

Thanks for reviewing and pointing out the proper diff format with full paths, as well as providing the patch. Do I need to close the revision here ?

You're welcome, thanks for the fix! :)

No, no need to close it, phabricator will do it automatically once it is committed.

This revision was automatically updated to reflect the committed changes.