Alembic not importing UVs (if file incorrectly sets geoScope to kVertexScope - even though actual data implies kFacevaryingScope - which 2.93 handled gracefully) #93906

Closed
opened 2021-12-09 16:25:59 +01:00 by zhangliqi · 16 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3070 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.19

Blender Version
Broken: version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: f1cca30557
Worked: 2.93

Since 3385c04598 we are more strict in regards to "malformed" .abc (see discussion below)

Short description of error
in 2.93 import no question
but 3.0 uv data lost
abc file{F12721151}

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3070 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 472.19 **Blender Version** Broken: version: 3.0.0, branch: master, commit date: 2021-12-02 18:35, hash: `f1cca30557` Worked: 2.93 Since 3385c04598 we are more strict in regards to "malformed" .abc (see discussion below) **Short description of error** in 2.93 import no question but 3.0 uv data lost abc file{[F12721151](https://archive.blender.org/developer/F12721151/alembic_file.abc)}
Author

Added subscriber: @shadow_creeper

Added subscriber: @shadow_creeper
zhangliqi changed title from abc import mmd 同 to import mmd turn to abc ,uv data lost 2021-12-09 16:43:34 +01:00

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

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

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Philipp Oeser self-assigned this 2021-12-10 09:25:29 +01:00
Member

Will check.

Will check.
Member

So, first findings:

  • importing this .abc was fine in 2.93, then

If I compare a simple .abc export of a cube with UVs [current master] and provided .abc I see the following:


/Cube/Cube/.geom:
ScalarProperty      float64_t[6]   .selfBnds[1] {interpretation=box}
ArrayProperty       float32_t[3]   P[1] {
                                    geoScope=vtx
                                    interpretation=point
                                   }
ArrayProperty       int32_t        .faceIndices[1]
ArrayProperty       int32_t        .faceCounts[1]
CompoundProperty                   .userProperties
CompoundProperty                   .arbGeomParams
CompoundProperty                   uv {
                                    arrayExtent=1
                                    geoScope=fvr
                                    interpretation=vector
                                    isGeomParam=true
                                    podExtent=2
                                    podName=float32_t
                                    sourceName=UVMap
                                   }
ArrayProperty       float32_t[3]   N[1] {
                                    arrayExtent=1
                                    geoScope=fvr
                                    interpretation=normal
                                    isGeomParam=true
                                    podExtent=3
                                    podName=float32_t
                                   }
/Cube/Cube/.userProperties:
ScalarProperty      bool_t         meshtype[1]
/Cube/Cube/uv:
ArrayProperty       float32_t[2]   .vals[1] {
                                    arrayExtent=1
                                    geoScope=fvr
                                    interpretation=vector
                                    isGeomParam=true
                                    podExtent=2
                                    podName=float32_t
                                    sourceName=UVMap
                                   }
/xform_0_material_0/mesh_0_material_0/.geom:
ScalarProperty      float64_t[6]   .selfBnds[101] {interpretation=box}
ArrayProperty       float32_t[3]   P[101] {
                                    geoScope=vtx
                                    interpretation=point
                                   }
ArrayProperty       int32_t        .faceIndices[101]
ArrayProperty       int32_t        .faceCounts[101]
ArrayProperty       float32_t[2]   uv[101] {
                                    arrayExtent=1
                                    geoScope=vtx
                                    interpretation=vector
                                    isGeomParam=true
                                    podExtent=2
                                    podName=float32_t
                                   }
ArrayProperty       float32_t[3]   N[101] {
                                    arrayExtent=1
                                    geoScope=vtx
                                    interpretation=normal
                                    isGeomParam=true
                                    podExtent=3
                                    podName=float32_t
                                   }

Seems like UVs are stored in plain ArrayProperty (instead of CompoundProperty / userProperties), also the sourceName is missing.
Checking why this was still importing fine before f9567f6c63 now.

@shadow_creeper : was this .abc exported from blender? (which version?)

So, first findings: - importing this .abc was fine in 2.93, then - started crashing with f9567f6c63 - crash was fixed by 7c68147709 (but no more UVs) If I compare a simple .abc export of a cube with UVs [current master] and provided .abc I see the following: ``` /Cube/Cube/.geom: ScalarProperty float64_t[6] .selfBnds[1] {interpretation=box} ArrayProperty float32_t[3] P[1] { geoScope=vtx interpretation=point } ArrayProperty int32_t .faceIndices[1] ArrayProperty int32_t .faceCounts[1] CompoundProperty .userProperties CompoundProperty .arbGeomParams CompoundProperty uv { arrayExtent=1 geoScope=fvr interpretation=vector isGeomParam=true podExtent=2 podName=float32_t sourceName=UVMap } ArrayProperty float32_t[3] N[1] { arrayExtent=1 geoScope=fvr interpretation=normal isGeomParam=true podExtent=3 podName=float32_t } /Cube/Cube/.userProperties: ScalarProperty bool_t meshtype[1] /Cube/Cube/uv: ArrayProperty float32_t[2] .vals[1] { arrayExtent=1 geoScope=fvr interpretation=vector isGeomParam=true podExtent=2 podName=float32_t sourceName=UVMap } ``` ``` /xform_0_material_0/mesh_0_material_0/.geom: ScalarProperty float64_t[6] .selfBnds[101] {interpretation=box} ArrayProperty float32_t[3] P[101] { geoScope=vtx interpretation=point } ArrayProperty int32_t .faceIndices[101] ArrayProperty int32_t .faceCounts[101] ArrayProperty float32_t[2] uv[101] { arrayExtent=1 geoScope=vtx interpretation=vector isGeomParam=true podExtent=2 podName=float32_t } ArrayProperty float32_t[3] N[101] { arrayExtent=1 geoScope=vtx interpretation=normal isGeomParam=true podExtent=3 podName=float32_t } ``` Seems like UVs are stored in plain `ArrayProperty` (instead of `CompoundProperty` / `userProperties`), also the `sourceName` is missing. Checking why this was still importing fine before f9567f6c63 now. @shadow_creeper : was this .abc exported from blender? (which version?)
Author

i use mikumikudance softwave of mikumiku bridge addon , .mmd exported to .abc
2.93 or c4d can import this abc
but 3.0 import will lost uv data
@philipp-14 Oeser (lichtwerk)

i use mikumikudance softwave of mikumiku bridge addon , .mmd exported to .abc 2.93 or c4d can import this abc but 3.0 import will lost uv data @philipp-14 Oeser (lichtwerk)
Author

Added subscriber: @philipp-14

Added subscriber: @philipp-14
Author

@philipp-14 Oeser
is it pssoble to do a test and use 2.93 code ti import if uv data is lost?

@philipp-14 Oeser is it pssoble to do a test and use 2.93 code ti import if uv data is lost?
Member

@shadow_creeper : I am on it, please use "lichtwerk" as my user name (poor Philipp Kant has been subscribed on accident to too many reports, sorry for this)

As it looks now, the real culprit commit is 3385c04598, but checking further...

@shadow_creeper : I am on it, please use "lichtwerk" as my user name (poor Philipp Kant has been subscribed on accident to too many reports, sorry for this) As it looks now, the real culprit commit is 3385c04598, but checking further...
Member

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'
Member

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren
Member

So the real "problem" is actually in the file I think.
It defines the geoScope of the ArrayProperty as being kVertexScope:

geoScope=vtx

The indices look like they are meant for face corners though (they dont match the vertex count, but they match the loop count).
Prior to 3385c04598, the scope wasnt checked as thoroughly, so face corners were always assumed [ and thus nobody noticed ;) -- everything was just read in as facecorner/loop data and all was good].
However, this is still an error in the file, if it exports the UVs on face corners, the scope should be kFacevaryingScope [ reg. C4D -- i can only assume they are sloopy as we were before 3385c04598 :) ]:

geoScope=fvr

I can get it to import just fine doing the following hack [@dr.sybren: this will never get allowed in master, right?]
P2656: T93906_hack



diff --git a/source/blender/io/alembic/intern/abc_customdata.cc b/source/blender/io/alembic/intern/abc_customdata.cc
index 830ec731e20..5d381a9aee3 100644
--- a/source/blender/io/alembic/intern/abc_customdata.cc
+++ b/source/blender/io/alembic/intern/abc_customdata.cc
@@ -611,6 +611,11 @@ AbcUvScope get_uv_scope(const Alembic::AbcGeom::GeometryScope scope,
     return ABC_UV_SCOPE_LOOP;
   }
 
+  /* Some software seems to be sloppy [writes loop UVs but specifies vertex scope...]. */
+  if (scope == kVertexScope && indices->size() == config.totloop) {
+    return ABC_UV_SCOPE_LOOP;
+  }
+
   /* kVaryingScope is sometimes used for vertex scopes as the values vary across the vertices. To
    * be sure, one has to check the size of the data against the number of vertices, as it could
    * also be a varying attribute across the faces (i.e. one value per face). */

Anyways, to understand the mikumiku workflow better:

  • what is actually doing the .abc export? blender? which blender version?
    • if so, please provide an example .blend file (where the MDD is already imported), the MDD -- just prior to exporting the abc
    • also provide the abc export settings then
  • if not: which software produces the .abc?
So the real "problem" is actually in the file I think. It defines the `geoScope` of the `ArrayProperty` as being `kVertexScope`: ``` geoScope=vtx ``` The indices look like they are meant for face corners though (they dont match the vertex count, but they match the loop count). Prior to 3385c04598, the scope wasnt checked as thoroughly, so face corners were always assumed [ and thus nobody noticed ;) -- everything was just read in as facecorner/loop data and all was good]. However, this is still an error in the file, if it exports the UVs on face corners, the scope should be `kFacevaryingScope` [ reg. C4D -- i can only assume they are sloopy as we were before 3385c04598 :) ]: ``` geoScope=fvr ``` I can get it to import just fine doing the following hack [@dr.sybren: this will never get allowed in master, right?] [P2656: T93906_hack](https://archive.blender.org/developer/P2656.txt) ``` diff --git a/source/blender/io/alembic/intern/abc_customdata.cc b/source/blender/io/alembic/intern/abc_customdata.cc index 830ec731e20..5d381a9aee3 100644 --- a/source/blender/io/alembic/intern/abc_customdata.cc +++ b/source/blender/io/alembic/intern/abc_customdata.cc @@ -611,6 +611,11 @@ AbcUvScope get_uv_scope(const Alembic::AbcGeom::GeometryScope scope, return ABC_UV_SCOPE_LOOP; } + /* Some software seems to be sloppy [writes loop UVs but specifies vertex scope...]. */ + if (scope == kVertexScope && indices->size() == config.totloop) { + return ABC_UV_SCOPE_LOOP; + } + /* kVaryingScope is sometimes used for vertex scopes as the values vary across the vertices. To * be sure, one has to check the size of the data against the number of vertices, as it could * also be a varying attribute across the faces (i.e. one value per face). */ ``` Anyways, to understand the mikumiku workflow better: - what is actually doing the .abc export? blender? which blender version? - if so, please provide an example .blend file (where the MDD is already imported), the MDD -- just prior to exporting the abc - also provide the abc export settings then - if not: which software produces the .abc?
Philipp Oeser removed their assignment 2021-12-17 10:47:55 +01:00
Member

Still waiting for answers to this:

In #93906#1270093, @lichtwerk wrote:
Anyways, to understand the mikumiku workflow better:

  • what is actually doing the .abc export? blender? which blender version?
    -- if so, please provide an example .blend file (where the MDD is already imported), the MDD -- just prior to exporting the abc
    -- also provide the abc export settings then
  • if not: which software produces the .abc?

For until then, will step down as the one assigned here...

Still waiting for answers to this: > In #93906#1270093, @lichtwerk wrote: > Anyways, to understand the mikumiku workflow better: > - what is actually doing the .abc export? blender? which blender version? > -- if so, please provide an example .blend file (where the MDD is already imported), the MDD -- just prior to exporting the abc > -- also provide the abc export settings then > - if not: which software produces the .abc? For until then, will step down as the one assigned here...
Philipp Oeser changed title from import mmd turn to abc ,uv data lost to Alembic not importing UVs (if file incorrectly sets geoScope to kVertexScope - even though actual data implies kFacevaryingScope - which 2.93 handled gracefully) 2021-12-17 10:49:43 +01:00
Member

Changed status from 'Needs User Info' to: 'Archived'

Changed status from 'Needs User Info' to: 'Archived'
Member

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed.

Thanks again for the report. If the problem persists please open a new report with the required information.

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed. Thanks again for the report. If the problem persists please open a new report with the required information.

Still waiting for answers to this:

In #93906#1270093, @lichtwerk wrote:
Anyways, to understand the mikumiku workflow better:

  • what is actually doing the .abc export? blender? which blender version?
    -- if so, please provide an example .blend file (where the MDD is already imported), the MDD -- just prior to exporting the abc
    -- also provide the abc export settings then
  • if not: which software produces the .abc?

For until then, will step down as the one assigned here...

I can provide you with some answers.
https://github.com/uimac/mmdbridge
In the link above is the source code of the software used in the report, where you can find some relevant information.
It is a software accessory plug-in, you can refer to the link below for the operation (but it does not help to solve the problem).
https://mmdbridge.vec4d.xyz/%E3%83%9B%E3%83%BC%E3%83%A0/usage-in-english
I need to use this software to export .abc because of some project requirements. Unfortunately, it still loses uv in Blender3.5 version (it is normal in 2.93 and other 3D software).
As you said, it might be a problem in the abc file. But it's not necessarily a bug, it could be to simplify the file size. And if it's a bug, you should get the same result in other 3D software.

1.png
2.png

Refer to the above script screenshot and source code file (you need to open the project file with VS to view the reference of d3d9), we only study mode 0 and 2, the behavior of mode 1 is very strange, and the result of mode 3 is the same as that of 0, so we don’t consider it for now. The case of mode 0 may be related to the loop count you said (it will be represented as missing uv in 3.5), and the mode 2 may be related to the vertex count (it works normally in 3.5). But the former only needs 200mb to export the .abc file of 100 frames, and the latter needs nearly 1000mb. This is a challenge for my hard drive.

3.png

Finally, you can find information about kVertexScope in the screenshot above (it's located in d3d9/alembic.cpp), but since I'm not a professional, I can't understand it.
I think it is necessary to reopen the report, hope this reply helps you to fix the error.

> Still waiting for answers to this: > > > In #93906#1270093, @lichtwerk wrote: > > Anyways, to understand the mikumiku workflow better: > > - what is actually doing the .abc export? blender? which blender version? > > -- if so, please provide an example .blend file (where the MDD is already imported), the MDD -- just prior to exporting the abc > > -- also provide the abc export settings then > > - if not: which software produces the .abc? > > > For until then, will step down as the one assigned here... I can provide you with some answers. https://github.com/uimac/mmdbridge In the link above is the source code of the software used in the report, where you can find some relevant information. It is a software accessory plug-in, you can refer to the link below for the operation (but it does not help to solve the problem). https://mmdbridge.vec4d.xyz/%E3%83%9B%E3%83%BC%E3%83%A0/usage-in-english I need to use this software to export .abc because of some project requirements. Unfortunately, it still loses uv in Blender3.5 version (it is normal in 2.93 and other 3D software). As you said, it might be a problem in the abc file. But it's not necessarily a bug, it could be to simplify the file size. And if it's a bug, you should get the same result in other 3D software. ![1.png](/attachments/d6a5c57e-a897-4658-b1cc-7d00f52e836f) ![2.png](/attachments/d8948e29-2ca5-4aa8-af62-093fa477cee6) Refer to the above script screenshot and source code file (you need to open the project file with VS to view the reference of d3d9), we only study mode 0 and 2, the behavior of mode 1 is very strange, and the result of mode 3 is the same as that of 0, so we don’t consider it for now. The case of mode 0 may be related to the loop count you said (it will be represented as missing uv in 3.5), and the mode 2 may be related to the vertex count (it works normally in 3.5). But the former only needs 200mb to export the .abc file of 100 frames, and the latter needs nearly 1000mb. This is a challenge for my hard drive. ![3.png](/attachments/7fc3ec01-7a92-4585-b84c-5fd4489f50aa) Finally, you can find information about kVertexScope in the screenshot above (it's located in d3d9/alembic.cpp), but since I'm not a professional, I can't understand it. I think it is necessary to reopen the report, hope this reply helps you to fix the error.
45 KiB
73 KiB
61 KiB
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 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#93906
No description provided.