Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send to Unreal - re.error: global flags not at the start of the expression at position 22 #729

Open
gerroon opened this issue Mar 23, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@gerroon
Copy link

gerroon commented Mar 23, 2024

Hi

Send to Unreal is throwing this error under Blender 4.2, Windows 11, version 2.4.3

In the description paste in and edit the following:

  • Addon: Send to Unreal
  • Steps to Reproduce the Problem:
    Add Suzanne, add a material to it, press push asset from the menu
  • Error Log: See below
  • OS: i.e.Windows
  • Addon Version: i.e. Send to Unreal 1.4.0
  • Blender Version: 4.2
  • Unreal Version: Unreal 5.3
Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\send2ue\operators.py", line 71, in modal
    raise error
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\send2ue\operators.py", line 61, in modal
    function(*args, **kwargs)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\send2ue\core\export.py", line 224, in export_mesh
    utilities.select_asset_collisions(asset_name, properties)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\send2ue\core\utilities.py", line 950, in select_asset_collisions
    for mesh_object in get_asset_collisions(asset_name, properties):
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\send2ue\core\utilities.py", line 636, in get_asset_collisions
    if is_collision_of(asset_name, mesh_object.name, properties):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\send2ue\core\utilities.py", line 832, in is_collision_of
    ) or re.fullmatch(
         ^^^^^^^^^^^^^
  File "C:\blender\4.2\python\Lib\re\__init__.py", line 171, in fullmatch
    return _compile(pattern, flags).fullmatch(string)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\blender\4.2\python\Lib\re\__init__.py", line 294, in _compile
    p = _compiler.compile(pattern, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\blender\4.2\python\Lib\re\_compiler.py", line 745, in compile
    p = _parser.parse(p, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\blender\4.2\python\Lib\re\_parser.py", line 989, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\blender\4.2\python\Lib\re\_parser.py", line 464, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\blender\4.2\python\Lib\re\_parser.py", line 850, in _parse
    raise source.error('global flags not at the start '
re.error: global flags not at the start of the expression at position 22
Error: Python: Traceback (most recent call last):
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\send2ue\operators.py", line 71, in modal
    raise error
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\send2ue\operators.py", line 61, in modal
    function(*args, **kwargs)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\send2ue\core\export.py", line 224, in export_mesh
    utilities.select_asset_collisions(asset_name, properties)
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\send2ue\core\utilities.py", line 950, in select_asset_collisions
    for mesh_object in get_asset_collisions(asset_name, properties):
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\send2ue\core\utilities.py", line 636, in get_asset_collisions
    if is_collision_of(asset_name, mesh_object.name, properties):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\send2ue\core\utilities.py", line 832, in is_collision_of
    ) or re.fullmatch(
         ^^^^^^^^^^^^^
  File "C:\blender\4.2\python\Lib\re\__init__.py", line 171, in fullmatch
    return _compile(pattern, flags).fullmatch(string)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\blender\4.2\python\Lib\re\__init__.py", line 294, in _compile
    p = _compiler.compile(pattern, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\blender\4.2\python\Lib\re\_compiler.py", line 745, in compile
    p = _parser.parse(p, flags)
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\blender\4.2\python\Lib\re\_parser.py", line 989, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\blender\4.2\python\Lib\re\_parser.py", line 464, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\blender\4.2\python\Lib\re\_parser.py", line 850, in _parse
    raise source.error('global flags not at the start '
re.error: global flags not at the start of the expression at position 22



@gerroon gerroon added the bug Something isn't working label Mar 23, 2024
@redemprez
Copy link

redemprez commented Mar 27, 2024

I confirm this bug - also present in Blender 4.1. It would be great if it would be fixed. Maybe @JoshQuake could come for rescue? ;)

@JoshQuake
Copy link
Contributor

I confirm this bug - also present in Blender 4.1. It would be great if it would be fixed. Maybe @JoshQuake could come for rescue? ;)

lol I haven't updated to 4.1 yet but might as well take a look

@PGSCOM
Copy link

PGSCOM commented Mar 28, 2024

I confirm this bug - also present in Blender 4.1. It would be great if it would be fixed. Maybe @JoshQuake could come for rescue? ;)

lol I haven't updated to 4.1 yet but might as well take a look

It also happens in 4.1, I have not updated yet and I have stayed on 4.0

@JoshQuake
Copy link
Contributor

JoshQuake commented Mar 28, 2024

Here's a temp fix that removes (?i) regex from default lod_regex value. Global flags are not allowed mid string in blender 4.1+'s regex parser.

send2ue-2.4.3_v4fixes_28-03.zip

Created pull request #732 with fix as well

@redemprez
Copy link

@JoshQuake thanks very much, you are the boss. Although I still get error in Blender 4.1. Can you look at it (big please!) :)

image

@JoshQuake
Copy link
Contributor

@JoshQuake thanks very much, you are the boss. Although I still get error in Blender 4.1. Can you look at it (big please!) :)

image

can you check your LOD settings? If yours has (?i) then remove it from there.
image

@redemprez
Copy link

@JoshQuake - thank you, that was it! After removal plugin works correctly!

@MalikuMane
Copy link

It seems to be an issue with builds that use python 3.11. I built blender 4.0.2 with 3.11 and it also occurred there.

@JoshQuake thanks very much, you are the boss. Although I still get error in Blender 4.1. Can you look at it (big please!) :)
image

can you check your LOD settings? If yours has (?i) then remove it from there. image

@Puzzabug
Copy link

Thanks for this!

@3dcinetv
Copy link

@JoshQuake - thank you, that was it! After removal plugin works correctly!

what did you remove? did you "uncheck" LODs?

@JoshQuake
Copy link
Contributor

JoshQuake commented May 24, 2024

@JoshQuake - thank you, that was it! After removal plugin works correctly!

what did you remove? did you "uncheck" LODs?

Remove (?i) from the string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants