-
Notifications
You must be signed in to change notification settings - Fork 108
[SM64] Created new room system for exporting with additional objects #156
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
base: main
Are you sure you want to change the base?
Conversation
| return obj | ||
|
|
||
|
|
||
| def get_collection_props_from_context( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what this does
Looks recursive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah its using period separated props to grab a nested property that has to do with the collection in the list.
base_path - path to where the collection property is
collection_name - name of the collection property
index_name - name of an additional property you need to add that tracks the index of the currently selected item (for reordering, deleting, etc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copying from discord so it doesn't get lost
collection_name: tuple[str], # from base path, collection prop
the comment is only forcollection_name[0]
collection_name->collection_paths
index_name->index_paths
would also be clearer imo
and the function needs an explanation of what it's doing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
| return f"{base_list_name}.move_item" | ||
|
|
||
| def move_index(self): | ||
| """Move index of an item render queue while clamping it.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
item render queue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i just rewrote that, my brain must have broke when originally writing that comment
| """Move index of an item render queue while clamping it.""" | ||
| collection_base, collection, index = self.get_collection() | ||
|
|
||
| list_length = len(collection) - 1 # (index starts at 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what?
maybe this should be named max_index or last_index ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah makes much more sense. done
|
|
||
| list_length = len(collection) - 1 # (index starts at 0) | ||
| new_index = index + (-1 if self.direction == "UP" else 1) | ||
| setattr(collection_base, self.index_name[-1], max(0, min(new_index, list_length))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this assumes index_name[-1] is not a dot_path like get_collection_props_from_context suggests it is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in a7fc76b
Dragorn421
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test this, just looked at the code. This has been tested by others and is said to work well
|
If the room empties are not at the same location, then the additional object transforms are incorrect in a room. Otherwise, the code itself seems to be good. |
|
Hello great cozies. |
|
Hasty merge of fast64/main into this branch for reference https://github.com/Dragorn421/fast64/tree/sm64/room_improvements |
This system allows you to select certain objects to render with an sm64 room. It shows up as a UI list on room empties! I've created an example/demo blend file on how its used and I'll show some screenshots of the UI.
Test level:

Here I have room 2 inside of room 1:

The Room1 empty is the first item, which renders all of the children of room1, then the room3 exterior is rendered as well.
Room1 renders the outer box of room 2 and room 3:

Since room 3 is transitional, it renders the entirety of room 1 and room 4

Room 4 just renders the outer box of room 3

Its pretty simple to set this up, and requires you to use zero duplicates, and also lets you decide on how things should be ordered.
A more complex example of this would be the level I was working on that has 11 different rooms, and runs well on console. I was developing this feature alongside of this level so it is pretty well-tested as is.

Also:
