SourceIO
SourceIO copied to clipboard
Flexcontrollers may fail to import due tuples
Blender 3.4.1 (Linux)
SourceIO 5.0.3 e7cdf38de85895c35d4adc808d3b8c659d29e35c
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
- this zip have all source files used.
- Compile with Garry's Mod / SFM. I made a v49 model.
- Open Blender and import
face_complex_facerules.mdl
to get the first,face_simple_facerules_multi_controller.mdl
to get the second log withCreate 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.