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

Flexcontrollers may fail to import due tuples #197

Open
LoveRenamon opened this issue Apr 25, 2023 · 0 comments
Open

Flexcontrollers may fail to import due tuples #197

LoveRenamon opened this issue Apr 25, 2023 · 0 comments

Comments

@LoveRenamon
Copy link

LoveRenamon commented Apr 25, 2023

Blender 3.4.1 (Linux)
SourceIO 5.0.3 e7cdf38
the only additional operator for import was SOURCEIO_OT_mdl.create_flexe_drivers, everything else off
It may relates to #142

Description

basically for complex flex rules and when abuse of assignment statements %flex = %flex + controller, it may read as tuples and fail? welp, this is not a issue for me, but it's kinda expose some limitation for the current driver controller method.

Steps to Reproduce

  1. this zip have all source files used.
  2. Compile with Garry's Mod / SFM. I made a v49 model.
  3. Open Blender and import face_complex_facerules.mdl to get the first, face_simple_facerules_multi_controller.mdl to get the second log with Create drivers from flexes ticked

Relevant console output:

face_complex_facerules.mdl

[...] bunch of verbosity

Traceback (most recent call last):
  File "<bpy driver>", line 1, in <module>
NameError: name 'Shape_driver' is not defined

[...] more verbosity

Traceback (most recent call last):
  File "/home/me/.config/blender/blender-3.4.1-linux-x64/3.4/scripts/addons/SourceIO/blender_bindings/operators/source1_operators.py", line 49, in execute
    model_container = import_model_from_full_path(mdl_path, self.scale, self.create_flex_drivers,
  File "/home/me/.config/blender/blender-3.4.1-linux-x64/3.4/scripts/addons/SourceIO/blender_bindings/source1/mdl/model_loader.py", line 55, in import_model_from_full_path
    return import_model_from_files(str(name), file_list, scale,
  File "/home/me/.config/blender/blender-3.4.1-linux-x64/3.4/scripts/addons/SourceIO/blender_bindings/source1/mdl/model_loader.py", line 92, in import_model_from_files
    container = import_model_v49(file_list, scale, create_drives, re_use_meshes, unique_material_names,
  File "/home/me/.config/blender/blender-3.4.1-linux-x64/3.4/scripts/addons/SourceIO/blender_bindings/source1/mdl/v49/import_mdl.py", line 199, in import_model
    create_flex_drivers(mesh_obj, mdl)
  File "/home/me/.config/blender/blender-3.4.1-linux-x64/3.4/scripts/addons/SourceIO/blender_bindings/source1/mdl/v49/import_mdl.py", line 371, in create_flex_drivers
    {st.join(inputs)}
TypeError: sequence item 0: expected str instance, tuple found

I couldn't archive anthing useful where inputs is a tuple

face_simple_facerules_multi_controller.mdl

Traceback (most recent call last):
  File "/home/me/.config/blender/blender-3.4.1-linux-x64/3.4/scripts/addons/SourceIO/blender_bindings/operators/source1_operators.py", line 49, in execute
    model_container = import_model_from_full_path(mdl_path, self.scale, self.create_flex_drivers,
  File "/home/me/.config/blender/blender-3.4.1-linux-x64/3.4/scripts/addons/SourceIO/blender_bindings/source1/mdl/model_loader.py", line 55, in import_model_from_full_path
    return import_model_from_files(str(name), file_list, scale,
  File "/home/me/.config/blender/blender-3.4.1-linux-x64/3.4/scripts/addons/SourceIO/blender_bindings/source1/mdl/model_loader.py", line 92, in import_model_from_files
    container = import_model_v49(file_list, scale, create_drives, re_use_meshes, unique_material_names,
  File "/home/me/.config/blender/blender-3.4.1-linux-x64/3.4/scripts/addons/SourceIO/blender_bindings/source1/mdl/v49/import_mdl.py", line 199, in import_model
    create_flex_drivers(mesh_obj, mdl)
  File "/home/me/.config/blender/blender-3.4.1-linux-x64/3.4/scripts/addons/SourceIO/blender_bindings/source1/mdl/v49/import_mdl.py", line 229, in create_flex_drivers
    multi_controller = next(filter(lambda a: a.name == flex_controller_ui.nway_controller, mdl.flex_controllers)
StopIteration

While trying to debug further by make a model with less rules (ie.: just blink, wink thing), I discovered another limitation which may relates, using the bellow syntax format.:
flexcontroller groups range 0 1 ctrl1 ctrl2 ctrl3 ctrl4 it parses as multi_controller which is incorrect.
For each argument after range should be a mono flexcontroller, since theres no mono, stereo, or multi_ internal distiction when we use NoAutoDMXRules command.
Far as i know the distiction is always done by the faceposer, IA or some frontend tool (ie.: SFM) based on the actual controller prefixes and not based on the way we order each flex controller.
Note I'm not following the VDC's SFM Stereo sample but the same syntax style used by Left 4 Dead and Left 4 Dead 2 found at Starter Kits.



Also, was surprised SourceIO could recover my unused flexes and its flawless importing dense shape keys.

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

No branches or pull requests

1 participant