Skip to content

Support pattern matching in ModelToggle mod#169

Open
copygirl wants to merge 1 commit into
ExpiredPopsicle:mainfrom
copygirl:model-toggle-fuzzy-match
Open

Support pattern matching in ModelToggle mod#169
copygirl wants to merge 1 commit into
ExpiredPopsicle:mainfrom
copygirl:model-toggle-fuzzy-match

Conversation

@copygirl

@copygirl copygirl commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

My model has some parts that are separate, but should be shown/hidden as a unit, so I would have to create multiple ModelToggle mods for each part, all using the same redeem as a trigger. In some cases, the parts of the model share part of their name. So I figured it'd be nice to "fuzzily" match node names and apply to multiple at the same time, which thankfully, find_children already supports.

I decided to filter for only Node3D nodes, as those have the visible property we care about. And I enabled recursive search, since objects attached to bones may appear as children of those bones in the skeleton, apparently.

There is the possibility to create a helper method (such as models_set_visibility(bool) or so) to deduplicate code, but I decided to keep the changes straight-forward. If desired, I could include this suggestion.

Example

Model has "Belt", "Belt_Buckle", "Belt_Pouch" parts.
Specify Belt* for Model Name to be able to toggle visibility of all three at once.

@copygirl

copygirl commented Apr 6, 2026

Copy link
Copy Markdown
Contributor Author

If we wanted to go further, we could also allow specifying a list of model names easily, either via a comma-separated list or similar, or via supporting multi-line TextEdit inputs, which incidentally I needed for another mod of mine, so I might PR that, too.

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

Successfully merging this pull request may close these issues.

1 participant