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

Reorganize PFM Stub Storage and Add the SDL Show/Hide Modifier. #414

Merged
merged 3 commits into from
Jul 6, 2024

Conversation

Hoikas
Copy link
Member

@Hoikas Hoikas commented Jun 23, 2024

This centralizes the location of all PFM attribute stubs for easier maintenance and adds a modifier exposing xAgeSDLBoolShowHide and xAgeSDLIntShowHide. It should hopefully make life a little easier for creating global SDL controlled visibility type stuff.

This helps make Korman more maintainable by reducing potential
duplication of Python attribute definitions. Further, it simplifies the
code to create a Python File Node for a standard API file.
Logic trees can be shared, so it is conceivable that a logic tree might
be pre-exported more than once. They can already be created by artists
and referenced from multiple Advanced Logic modifiers, so this is good
for consistency.
@DoobesURU
Copy link
Contributor

So I slapped some show/hide SDL mods on a few objects. The Boolean SDL show/hide mods in Chiso seemed to work just fine.

However, the Integer show/hide mods in the Pub came back with this error:

Error: sequence item 0: expected str instance, int found
Traceback (most recent call last):
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\operators\op_export.py", line 228, in execute
    e.run()
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\exporter\convert.py", line 125, in run
    self._pre_export_scene_objects()
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\exporter\convert.py", line 563, in _pre_export_scene_objects
    do_pre_export(bl_obj)
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\exporter\convert.py", line 551, in do_pre_export
    gen_result = pre_result.send(gen_result)
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\properties\modifiers\base.py", line 247, in pre_export
    yield self.convert_logic(bo)
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\properties\modifiers\base.py", line 188, in convert_logic
    name = kwargs.pop("name", self.key_name)
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\properties\modifiers\logic.py", line 257, in key_name
    return f"cPythIntShowHide_{self.sdl_variable}_{'-'.join(self._int_states)}"
TypeError: sequence item 0: expected str instance, int found

location: <unknown location>:-1

location: <unknown location>:-1

@DoobesURU
Copy link
Contributor

New error after commit d19534b:

Error: 'xAgeSDLIntShowHide.py'
Traceback (most recent call last):
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\operators\op_export.py", line 228, in execute
    e.run()
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\exporter\convert.py", line 125, in run
    self._pre_export_scene_objects()
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\exporter\convert.py", line 563, in _pre_export_scene_objects
    do_pre_export(bl_obj)
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\exporter\convert.py", line 551, in do_pre_export
    gen_result = pre_result.send(gen_result)
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\properties\modifiers\base.py", line 247, in pre_export
    yield self.convert_logic(bo)
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\properties\modifiers\base.py", line 197, in convert_logic
    self.logicwiz(bo, **kwargs)
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\properties\modifiers\logic.py", line 257, in logicwiz
    pfm_node = self._create_standard_python_file_node(tree, "xAgeSDLIntShowHide.py")
  File "D:\Korman 0.16base\2.79\scripts\addons\korman\properties\modifiers\base.py", line 217, in _create_standard_python_file_node
    return self._create_python_file_node(tree, filename, plasma_api.python_files[filename])
KeyError: 'xAgeSDLIntShowHide.py'

location: <unknown location>:-1

location: <unknown location>:-1

This adds a modifier for the very common PythonFileMods
xAgeSDLBoolShowHude and xAgeSDLIntShowHide. Right now, Korman doesn't
try to parse SDL files, so the variable name and type have to be
specified manually. The benefit to this, however, is the ability to
easily wire up global SDL visibility type features.
@Hoikas Hoikas merged commit 7363930 into H-uru:master Jul 6, 2024
3 checks passed
@Hoikas Hoikas deleted the phony_pfm_reorg branch July 6, 2024 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants