def get_registered_image():
import itertools
reg = state.tag and renpy.get_registered_image(state.tag)
if state.tag and reg is None:
for attr_choice in itertools.product(state.attributes):
reg = renpy.get_registered_image(' '.join((state.tag,) + attr_choice))
if reg is not None:
return reg
In:
def get_ordered_layeredimage_attributes():
Assign:
reg = get_registered_image()
Replace both for with:
for group_att in reg.attributes:
At:
if isinstance(renpy.get_registered_image(state.tag), LayeredImage):
Replace with:
if isinstance(director.get_registered_image(), LayeredImage):
← Return to asset pack
Comments
Log in with itch.io to leave a comment.
Bug:
If LayeredImage is defined with spaces, the code doesn't trigger.
Suggested fix:
-> I uploaded all these changes to pastebin, if you prefer: https://pastebin.com/fBpRBPaR
After
Create:
def get_registered_image(): import itertools reg = state.tag and renpy.get_registered_image(state.tag) if state.tag and reg is None: for attr_choice in itertools.product(state.attributes): reg = renpy.get_registered_image(' '.join((state.tag,) + attr_choice)) if reg is not None: return regIn:
Assign:
Replace both for with:
At:
Replace with:
if isinstance(director.get_registered_image(), LayeredImage):Thank you for the attention
Bug:
It's possible for state.tag to be None.
`if isinstance(renpy.get_registered_image(state.tag), LayeredImage):`
When that happens, it causes an exception inside renpy when calling renpy.get_registered_image()
File "renpy/python.py", line 1375, in py_eval_bytecode
return eval(bytecode, globals, locals)
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "game/layeredimage-visual-editor-v3/01cute_layeredimage_editor.rpy", line 86, in <module>
if isinstance(renpy.get_registered_image(state.tag), LayeredImage):
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "renpy/display/image.py", line 310, in get_registered_image
name = tuple(name.split())
^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'split'
Reproduction steps: