Export to X3D Fails #94122

Closed
opened 2021-12-15 19:45:50 +01:00 by Steven Frank · 14 comments

System Information
Operating system: Windows 10
Graphics card: Nvidia GeForce GTX 1080

Blender Version
Broken: (version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: f1cca3055776, type: release)
Worked: (version: 2.93.5, branch: master, commit date: 2021-10-05 12:04, hash: a791bdabd0b2, type: release)

Short description of error
When trying to export a .blend file to .X3D (using default options), this error occurs and a zero-length file is produced
Info: starting X3D export to 'S:\MacraysKeep\VR\X3d\ImogenTemult_EF.x3d'...
Python: Traceback (most recent call last):

File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\io_scene_x3d\__init__.py", line 240, in execute
  return export_x3d.save(context, **keywords)
File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\io_scene_x3d\export_x3d.py", line 1590, in save
  export(file,
File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\io_scene_x3d\export_x3d.py", line 1523, in export
  export_main()
File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\io_scene_x3d\export_x3d.py", line 1519, in export_main
  export_object(ident, None, obj_main, obj_main_children)
File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\io_scene_x3d\export_x3d.py", line 1381, in export_object
  free, derived = create_derived_objects(scene, obj_main)
File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\modules\bpy_extras\io_utils.py", line 364, in create_derived_objects
  for ob in objects:

TypeError: 'Object' object is not iterable

location: :-1

Exact steps for others to reproduce the error
When trying to export a .blend file to .X3D (using default options)

**System Information** Operating system: Windows 10 Graphics card: Nvidia GeForce GTX 1080 **Blender Version** Broken: (version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: f1cca3055776, type: release) Worked: (version: 2.93.5, branch: master, commit date: 2021-10-05 12:04, hash: a791bdabd0b2, type: release) **Short description of error** When trying to export a .blend file to .X3D (using default options), this error occurs and a zero-length file is produced Info: starting X3D export to 'S:\\MacraysKeep\\VR\\X3d\\ImogenTemult_EF.x3d'... Python: Traceback (most recent call last): ``` File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\io_scene_x3d\__init__.py", line 240, in execute return export_x3d.save(context, **keywords) File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\io_scene_x3d\export_x3d.py", line 1590, in save export(file, File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\io_scene_x3d\export_x3d.py", line 1523, in export export_main() File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\io_scene_x3d\export_x3d.py", line 1519, in export_main export_object(ident, None, obj_main, obj_main_children) File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\addons\io_scene_x3d\export_x3d.py", line 1381, in export_object free, derived = create_derived_objects(scene, obj_main) File "C:\Program Files\Blender Foundation\Blender 3.0\3.0\scripts\modules\bpy_extras\io_utils.py", line 364, in create_derived_objects for ob in objects: ``` TypeError: 'Object' object is not iterable location: <unknown location>:-1 **Exact steps for others to reproduce the error** When trying to export a .blend file to .X3D (using default options)
Author

Added subscriber: @macrayblackhand

Added subscriber: @macrayblackhand
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Hi, thanks for the report. Can confirm on current master and 3.0.0.

I think problem appears because of the api changes (not sure)

Hi, thanks for the report. Can confirm on current master and 3.0.0. I think problem appears because of the api changes (not sure)

Added subscriber: @andreasplesch

Added subscriber: @andreasplesch

This commit changed the signature and return value of the create_derived_objects function:

a82c9e1e40

https://developer.blender.org/rBa82c9e1e405c84b9ab8b5c1f31d7e135ab41c101

(not sure what rB means in the commit hash, ok it refers to the Blender repo)

This commit changed the signature and return value of the create_derived_objects function: https://github.com/blender/blender/commit/a82c9e1e405c84b9ab8b5c1f31d7e135ab41c101 https://developer.blender.org/rBa82c9e1e405c84b9ab8b5c1f31d7e135ab41c101 (not sure what rB means in the commit hash, ok it refers to the Blender repo)

I had good success by adopting the new signature and converting the return value back to what was provided before the commit:

    - -------------------------------------------------------------------------
    - Export Object Hierarchy (recursively called)
    # -------------------------------------------------------------------------
    def export_object(ident, obj_main_parent, obj_main, obj_children):
        matrix_fallback = mathutils.Matrix()
        world = scene.world
        - import pdb; pdb.set_trace()
        - free, derived = create_derived_objects(scene, obj_main)
        derived_dict = create_derived_objects(depsgraph, [obj_main])
        derived = list(derived_dict.values())[0]

        if use_hierarchy:

I tested that with the default cube and a larger blend, generating the same .x3d as before.
Hopefully that can help somebody.

A more readable alternative is:

    - -------------------------------------------------------------------------
    - Export Object Hierarchy (recursively called)
    # -------------------------------------------------------------------------
    def export_object(ident, obj_main_parent, obj_main, obj_children):
        matrix_fallback = mathutils.Matrix()
        world = scene.world
        - import pdb; pdb.set_trace()
        - 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:
I had good success by adopting the new signature and converting the return value back to what was provided before the commit: ``` - ------------------------------------------------------------------------- - Export Object Hierarchy (recursively called) # ------------------------------------------------------------------------- def export_object(ident, obj_main_parent, obj_main, obj_children): matrix_fallback = mathutils.Matrix() world = scene.world - import pdb; pdb.set_trace() - free, derived = create_derived_objects(scene, obj_main) derived_dict = create_derived_objects(depsgraph, [obj_main]) derived = list(derived_dict.values())[0] if use_hierarchy: ``` I tested that with the default cube and a larger blend, generating the same .x3d as before. Hopefully that can help somebody. A more readable alternative is: ``` - ------------------------------------------------------------------------- - Export Object Hierarchy (recursively called) # ------------------------------------------------------------------------- def export_object(ident, obj_main_parent, obj_main, obj_children): matrix_fallback = mathutils.Matrix() world = scene.world - import pdb; pdb.set_trace() - 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: ```
Here is a quick github fork with the change: https://github.com/andreasplesch/blender-addons/commit/5192a43323c73a2841e059f31f2e408e0374903d diff view: https://github.com/blender/blender-addons/compare/master...andreasplesch:x3d_export_fix

This issue was referenced by c7be983489

This issue was referenced by c7be9834895821678616edbc78d54ea8006d096e

This issue was referenced by 1679f2fdbb

This issue was referenced by 1679f2fdbb1373a255b98b69c6dc2f8a90e7170a

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Bastien Montagne self-assigned this 2021-12-27 15:48:03 +01:00
Author

Will this thread be notified when the version in which this fix resides is released?

Will this thread be notified when the version in which this fix resides is released?
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

In #94122#1283304, @macrayblackhand wrote:
Will this thread be notified when the version in which this fix resides is released?

It is in 3.1 daily builds from https://builder.blender.org/download/daily/ and on the list blender/blender#93479 (3.0 Potential candidates for corrective releases)
But no, no automatic notification here if 3.0.1 is released, please keep an eye on it.

> In #94122#1283304, @macrayblackhand wrote: > Will this thread be notified when the version in which this fix resides is released? It is in 3.1 daily builds from https://builder.blender.org/download/daily/ and on the list blender/blender#93479 (3.0 Potential candidates for corrective releases) But no, no automatic notification here if 3.0.1 is released, please keep an eye on it.
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#94122
No description provided.