Skip to content

Handle exportMonoBehavior for Object without serialized type or nodes - #138

Merged
K0lb3 merged 1 commit into
K0lb3:masterfrom
sparr:exportmonobehavior_object_error
Oct 2, 2022
Merged

K0lb3 merged 1 commit into
K0lb3:masterfrom
sparr:exportmonobehavior_object_error

Conversation

@sparr

@sparr sparr commented Sep 24, 2022

Copy link
Copy Markdown
Contributor

While exporting assets from the game "As Far As The Eye" I encountered a call to exportMonoBehaviour for an Object (not a MonoBehaviour), when the Object failed the if obj.serialized_type and obj.serialized_type.nodes: test. This led to:

  File "/home/sparr/.local/share/virtualenvs/vgm-extractor-1oHW3IDG/src/unitypy/UnityPy/tools/extractor.py", line 219, in exportMonoBehaviour
    if not export:
UnboundLocalError: local variable 'export' referenced before assignment

So I've initialized it here to avoid this error.

@K0lb3

K0lb3 commented Oct 2, 2022

Copy link
Copy Markdown
Owner

Oh, that's indeed a problem.

@K0lb3
K0lb3 merged commit 5d7fef5 into K0lb3:master Oct 2, 2022
K0lb3 pushed a commit that referenced this pull request Oct 18, 2022
…return type. (#140)

* Disambiguate path_id collision using obj type

* Pass asset_filter from extract_assets to export_obj (#139)

* Handle exportMonoBehavior for Object without serialized type or nodes (#138)

* Use obj.assets_file instead of .type to disambiguate .path_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants