-
Notifications
You must be signed in to change notification settings - Fork 51
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
EDITOR-#620. Finish partially load frames of selected dancers/time range #628
base: main
Are you sure you want to change the base?
Conversation
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.
Well done! But some minor changes required as I commented in the code, and little bugs to be fixed:
- Using the timeline frame jumper and time input users can jump to frames outside of the selected time interval, fix this in
core/actions/state/timeline.py
andset_time()
incore/actions/property/timeline.py
.
![圖片](https://private-user-images.githubusercontent.com/106340233/411321439-7d5960d4-fd56-471a-8645-d060871039df.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MzA3MDksIm5iZiI6MTczOTUzMDQwOSwicGF0aCI6Ii8xMDYzNDAyMzMvNDExMzIxNDM5LTdkNTk2MGQ0LWZkNTYtNDcxYS04NjQ1LWQwNjA4NzEwMzlkZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNFQxMDUzMjlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zNzUzZWMyOWMxMTJlMmVhYTg2NGI1YjM2MDExOGUyMGJhMGRhZGM0YzU0ZmY5YmE5MjgzODQ3MjNmNTM4ZDdhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.uomb-Begpfziz30633KUCsodLXXY3yafAqMgIDvBo6M)
bpy.context.scene.frame_start = 0 | ||
bpy.context.scene.frame_end = bpy.context.scene.sequence_editor.sequences[ | ||
0 | ||
].frame_duration |
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.
Keep these, the users should be able to preview the time interval they are selecting, if you remove this part the frame interval will be locked to 1~250 before partial load.
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 want you to update context.scene.frame_{start,end}
at update of these UI properties, so the users can preview the interval they're selecting before proceeding. (FYI, I'm planning to mark the start of scenes (幕) in another PR.)
) | ||
|
||
|
||
def linear_interpolation(lval: float, ldist: int, rval: float, rdist: int): |
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.
Maybe move this to algorithm.py
@@ -88,6 +93,7 @@ async def add_control_frame(): | |||
set_requesting(False) | |||
|
|||
|
|||
# TODO finish this function |
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.
You should remove those TODOs after finishing them, or they're going to accumulate in our repo.
@@ -1,3 +1,5 @@ | |||
from functools import reduce |
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.
Cool.
@@ -195,6 +197,11 @@ def poll(cls, context: bpy.types.Context | None): | |||
) | |||
return state.ready and ld_ui_led_editor.edit_part != "" | |||
|
|||
elif state.editor == Editor.CONTROL_EDITOR: |
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.
You should do the same thing to the delete button in position and control
class LoadPartialOperator(AsyncOperator): | ||
bl_idname = "lightdance.load_partial" | ||
bl_label = "Load frames in selected interval" | ||
bl_label = "Load frames for selected dancers" | ||
# bl_label = "Load frames in selected interval" | ||
|
||
async def async_execute(self, context: bpy.types.Context): | ||
# TODO |
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.
Remove this TODO comment since you already finished it
import bpy | ||
from bpy.types import Context, UILayout |
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 think this is necessary, using bpy
types without bpy.*
could be confusing IMO.
749b446
to
d9ca256
Compare
What is this PR for?
This Pull Request aims to add the feature of partially load frames of selected dancers/time range
What type of PR is it?
Feature
Todos
None.
What is the Github issue?
#620
How should this be tested?
Screenshots (if appropriate)
Questions