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

LayeredImage auto not populating attributes #5518

Open
morkalmarrh opened this issue May 16, 2024 · 6 comments
Open

LayeredImage auto not populating attributes #5518

morkalmarrh opened this issue May 16, 2024 · 6 comments

Comments

@morkalmarrh
Copy link

morkalmarrh commented May 16, 2024

First of all, thanks for making RenPy. I think what I have may be a bug and not me being stupid, but if I am, sorry!

Using auto doesn't populate the attributes of a layeredimage for me (8.2.1). They can't be used in the file ('unknow attribute' when using show, nothing at all with a proxied side images). They don't show up on the inspector.

Uncertain if this truly is a but but I've seen a related issue here: https://lemmasoft.renai.us/forums/viewtopic.php?t=50663 and here https://lemmasoft.renai.us/forums/viewtopic.php?t=60875. I notice someone could only fix it by starting a new file.

My project is quite new. I tried a force recompile, but no real success.

RenPy has no problem finding the images. A direct call to them or just group eyes: attribute frown will find character_eyes_frown for example. The issue I am having is just that auto isn't... being very automatic.

Additionally, when I define attributes as 'attribute frown' (instead of attribute frown: "images/character/eyes/character_eyes_frown.png") I can't remove defaults. When I define it with the exact filepath, I can remove defaults. When using attribute frown, when I right click to toggle it off, the editor recognises I've turned it off, but then doesn't actually turn it off. I'm aware that removing a character's eyes is a bizarre use case but you know what I mean.

 layeredimage character:

    attribute body default

    group right auto:

        attribute down default

    group left auto:

        attribute norm default

    group eyes auto

    group mouth auto

    group brows auto

    attribute fringe default

image side character = LayeredImageProxy("character")

define k = Character("Character", image="character")

Here it is. Files are set up as /images/<character>/<group>/<character>_<group>_<attribute>.png but folding them into the base didn't help. As stated, RenPy is finding them just fine, just not for auto.

EDIT: Fixed copy-paste idnenting issue, sorry for confusion.

@Gouvernathor
Copy link
Member

Your code has indent issues.
The behavior of layeredimages, unless you provide all attributes explicitly (which you don't, and that's good), is very dependent on how you name your files - and also not at all dependent on what folder you put them in.
Can you share a list of your file names (not the files themselves or their full path, as long as they are somewhere inside the image folder). Maybe not a full list, but so we get an idea.

@morkalmarrh
Copy link
Author

morkalmarrh commented May 17, 2024

Hi, yes, sorry, the actualy code doesn't, I copied and pasted it badly.

image

Here it is. I've also edited the code snippet to be correct.

it's:

character_left_norm.png
character_right_down.png
character_eyes_squint.png
character_eyes_soft.png
character_brows_angry.png
character_brows_sad.png
character_mouth_frown.png
character_mouth_grin.png
character_fringe.png
character_body.png

@Gouvernathor
Copy link
Member

I reproduce that behavior using dummy images (show character sad or show character soft say that the attribute is unknown) but my own layeredimages keep working as usual, so it's not obvious to me what the problem is.

@morkalmarrh
Copy link
Author

morkalmarrh commented May 17, 2024

How strange. That's the file names, though it's actually:

images/character/character_fringe.png
images/character/character_body.png
images/character/arms/character_right_down.png
images/character/arms/character_left_norm.png
images/character/eyes/character_eyes_soft.png

etc. To my understanding though the pattern ignores the folders and the folders are just for our benefit as devs.

But as mentioned, collapsing everything down into the images folder and recompiling didn't fix the issue, so it must be something I've written into this snippet. Thank you for testing it, I'll keep trying to tweak small things and see what it is I've done incorrectly. I avoided the usual strings we should avoid in Python... probably isn't the names themselves. I'll be back if I find what it is that RenPy is disliking. :^ )

@renpytom
Copy link
Member

Any luck yet?

@morkalmarrh
Copy link
Author

Ah, sorry - nah, no luck. I have no idea what the issue is!

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

3 participants