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

EDITOR-#620. Finish partially load frames of selected dancers/time range #628

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ExuberantIris
Copy link

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

  • Do the license files need updating? No
  • Are there breaking changes for older versions? No
  • Does this need new documentation? No

Copy link
Contributor

@Chalkman071 Chalkman071 left a 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 and set_time() in core/actions/property/timeline.py.
圖片

bpy.context.scene.frame_start = 0
bpy.context.scene.frame_end = bpy.context.scene.sequence_editor.sequences[
0
].frame_duration
Copy link
Contributor

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.

Copy link
Contributor

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):
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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:
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

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.

2 participants