State:New|TargetRelease:No Target|icon_bug|icon_nuke|database:public|Resolution:Fixed|BugID:590573|
from hiero.core import MediaSource, Clip, BinItem def makeOfflineClips(project, endFrame, quantity): for i in range(quantity): offline = MediaSource.createOfflineVideoMediaSource(f"/tmp/clip_{i}.######.exr", 1, endFrame, 24) clip = Clip(offline) clip.createEffect("Grade") project.clipsBin().addItem(BinItem(clip)) project = hiero.core.projects()[-1] makeOfflineClips(project, 24, 300)
2) Next, execute the following code to create a function that will disable or enable the Soft Effects in each Clip:
import timeflag = Truedef toggle_effects(checked): action_name = "Enable Clip Effects" if checked else "Disable Clip Effects" project.beginUndo(action_name) for clip in project.clips(): effects = clip.effects() for effect in effects: effect.setEnabled(checked) project.endUndo()
3) Run the following lines a few times to execute the function, and note how it generally takes 2.5 seconds to complete:
start = time.perf_counter() toggle_effects(flag) end = time.perf_counter()flag = not flagprint(f'Toggle Effects took {end - start:.6f} seconds to execute') HIERO_DISABLE_THUMBNAILS=1 environment variable does not alter the results.for widget in hiero.ui.windowManager().windows(): if widget.windowTitle() == "Project": binView = widget binTreeViews = binView.findChildren(QTreeView) for treeview in binTreeViews: treeview.collapseAll()
We're sorry to hear that
Please tell us why