Skip to content

Commit bc9e2a4

Browse files
committed
Clean up files and some fallback logic
1 parent bfec630 commit bc9e2a4

File tree

5 files changed

+20
-33
lines changed

5 files changed

+20
-33
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ to attach them to the start of each source file to most effectively
631631
state the exclusion of warranty; and each file should have at least
632632
the "copyright" line and a pointer to where the full notice is found.
633633

634-
Blender Fast Start (MP4/MOV), moov atom to the front of the file.
634+
BL Fast Start (MP4/MOV), moov atom to the front of the file.
635635
Copyright (C) 2025 usrname0
636636

637637
This program is free software: you can redistribute it and/or modify

blender_manifest.toml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
schema_version = "1.0.0"
55
id = "BL_FastStart"
6-
version = "1.9.0"
6+
version = "1.9.1"
77

88
name = "BL Fast Start (MP4/MOV)"
99
author = "usrname0 (AI assisted)"
@@ -25,4 +25,14 @@ description = """Youtube recommends MP4 + moov atom at the front of the file (Fa
2525
This checkbox creates an extra MP4/MOV file with a custom suffix (default '-faststart').
2626
Your normal render is untouched."""
2727

28-
tags = ["Render", "User Interface"]
28+
tags = ["Render", "User Interface"]
29+
30+
[build]
31+
paths_exclude_pattern = [
32+
"__pycache__/",
33+
"/.git/",
34+
"/.gitignore",
35+
"/README.md",
36+
"/*.zip",
37+
"examples/",
38+
]

extension_logic.py

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,7 @@ def post_render_faststart_handler(scene, depsgraph=None):
313313
user_setting_basename = ""
314314
if os.path.isdir(abs_filepath_setting):
315315
blender_output_dir = abs_filepath_setting
316-
if bpy.data.is_saved and bpy.data.filepath: user_setting_basename = Path(bpy.data.filepath).stem
317-
else: user_setting_basename = ""
316+
user_setting_basename = ""
318317
else:
319318
blender_output_dir = os.path.dirname(abs_filepath_setting)
320319
user_setting_basename = os.path.basename(abs_filepath_setting)
@@ -323,7 +322,6 @@ def post_render_faststart_handler(scene, depsgraph=None):
323322
print(f"Fast Start (post_render): Blender output directory: '{blender_output_dir}'")
324323
print(f"Fast Start (post_render): Effective user setting basename: '{user_setting_basename}'")
325324

326-
# --- Start of Revised Naming Logic ---
327325
base_for_construction = ""
328326
frame_padding_final = 0
329327
suffix_for_constructor = "" # Text between frame numbers and the very final extension
@@ -415,7 +413,6 @@ def post_render_faststart_handler(scene, depsgraph=None):
415413
frame_padding_final,
416414
final_extension_for_constructor
417415
)
418-
# --- End of Revised Naming Logic ---
419416

420417
potential_final_path = os.path.join(blender_output_dir, predicted_blender_filename)
421418
print(f"Fast Start (post_render): Predicted Blender output file: '{potential_final_path}'")
@@ -429,21 +426,12 @@ def post_render_faststart_handler(scene, depsgraph=None):
429426

430427
if not original_rendered_file:
431428
if os.path.isdir(abs_filepath_setting):
432-
if use_blender_file_extensions_setting:
433-
blend_name_base = ""
434-
if bpy.data.is_saved and bpy.data.filepath: blend_name_base = Path(bpy.data.filepath).stem
435-
if blend_name_base:
436-
alt_filename_blend = _construct_video_filename(blend_name_base, "", start_frame, end_frame, 4, final_extension_for_constructor if use_blender_file_extensions_setting else "")
437-
alt_path_blend = os.path.join(blender_output_dir, alt_filename_blend)
438-
if os.path.exists(alt_path_blend) and not os.path.isdir(alt_path_blend):
439-
original_rendered_file = alt_path_blend
440-
print(f"Fast Start (post_render): Found with fallback (blend name in dir): {original_rendered_file}")
441-
if not original_rendered_file:
442-
alt_filename_frames = _construct_video_filename("", "", start_frame, end_frame, 4, final_extension_for_constructor if use_blender_file_extensions_setting else "")
443-
alt_path_frames = os.path.join(blender_output_dir, alt_filename_frames)
444-
if os.path.exists(alt_path_frames) and not os.path.isdir(alt_path_frames):
445-
original_rendered_file = alt_path_frames
446-
print(f"Fast Start (post_render): Found with fallback (frames in dir): {original_rendered_file}")
429+
# Based on observation, Blender uses an empty base name (just frames) when outputting to a directory.
430+
alt_filename_frames = _construct_video_filename("", "", start_frame, end_frame, 4, final_extension_for_constructor)
431+
alt_path_frames = os.path.join(blender_output_dir, alt_filename_frames)
432+
if os.path.exists(alt_path_frames) and not os.path.isdir(alt_path_frames):
433+
original_rendered_file = alt_path_frames
434+
print(f"Fast Start (post_render): Found with fallback (frames in dir): {original_rendered_file}")
447435

448436
if not original_rendered_file:
449437
print(f"Fast Start (post_render) ERROR: Could not find the actual rendered file after fallbacks. "

qtfaststart_lib/__main__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

qtfaststart_lib/processor.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,6 @@ def _ensure_valid_index(index):
110110
raise MalformedFileError(msg)
111111

112112

113-
def find_atoms(size, datastream):
114-
"""
115-
Compatibilty interface for _find_atoms_ex
116-
"""
117-
fake_parent = Atom('fake', datastream.tell()-8, size+8)
118-
for atom in _find_atoms_ex(fake_parent, datastream):
119-
yield atom.name
120-
121-
122113
def _find_atoms_ex(parent_atom, datastream):
123114
"""
124115
Yield either "stco" or "co64" Atoms from datastream.

0 commit comments

Comments
 (0)