ID 501607 - Errors when loading Object versions via Python if the current version's geo hierarchy was selected in Add Version Settings

Follow

Problem summary
Errors when loading Object versions via Python if the current version's geo hierarchy was selected in Add Version Settings

This issue can occur with FBX and Alembic files.

Customer reported version
Mari 4.7v2

Customer reported platform
CentOS 7

Steps to reproduce

1) Download the attached Cube.abc

2) Open any project

3) Right click the Object and select Add Version

4) In the Add Version dialog, select Cube.abc for the geometry 

5) Expand and select the hierarchy so that it is highlighted like below and then click OK



6) In the Objects palette, switch to the new version​

7) Run the following snippet in the Python Console, replacing path/to/file with the path to Cube.abc:

path = "path/to/file"
mari.geo.current().addVersion(path, "test")
Expected behaviour
Cube.abc should be imported as a new Object version.

Actual behaviour
An error occurs, saying that the file contains no geometry:



However, the same file can be loaded as a new Object version via the UI.

Workaround
To prevent the error, you can run the script below on the current Object version:
current_version = mari.geo.current().currentVersion()
version_settings = current_version.settings()
version_settings["SelectedObjectNodeCount"] = "0"
current_version.setSettings(version_settings)
After running this snippet, additional Object versions should load via Python without erroring.

Reproduced by support
This bug has been reproduced in:
Mari 5.0v1 - Windows 10 - CentOS 7.9
Mari 4.8v1 - Windows 10
Mari 4.7v1 - Windows 10
Mari 4.6v1 - Windows 10
Mari 4.5v1 - Windows 10
Mari 4.0v1 - Windows 10 - CentOS 7.9

Earliest version tested
Mari 4.0v1 - This issue appears to be in all versions of the product


    We're sorry to hear that

    Please tell us why