Skip to content

fix: remove conflicting default=True from store_true CLI flags#13

Open
octo-patch wants to merge 1 commit intomicrosoft:mainfrom
octo-patch:fix/issue-12-save-video-dump-blend-defaults
Open

fix: remove conflicting default=True from store_true CLI flags#13
octo-patch wants to merge 1 commit intomicrosoft:mainfrom
octo-patch:fix/issue-12-save-video-dump-blend-defaults

Conversation

@octo-patch
Copy link
Copy Markdown

Fixes #12

Problem

Two CLI flags use both action='store_true' and default=True, which makes them permanently enabled regardless of whether the flag is passed:

  • --save_video in batch_infer.py: always generates a video, even when users don't want it
  • --dump_blend in scene_processor/to_blend.py: always saves the Blender file

With action='store_true', argparse already defaults the value to False and flips it to True only when the flag is present. The default=True overrides this, so both flags are stuck at True — making them impossible to disable.

Note: --save_img on the very next line in to_blend.py correctly uses only action='store_true' without default=True, confirming the default=True values are unintentional.

Solution

Remove the redundant default=True from both argument definitions so they behave as opt-in flags (default: False).

Testing

Verified with Python's argparse:

parser.add_argument("--save_video", action='store_true')
args = parser.parse_args([])        # args.save_video == False ✓
args = parser.parse_args(['--save_video'])  # args.save_video == True ✓

…icrosoft#12)

--save_video in batch_infer.py and --dump_blend in scene_processor/to_blend.py
both used action='store_true' combined with default=True, making them permanently
enabled regardless of whether the flag was passed. Removed the redundant default=True
so both flags behave as opt-in (default False).
Comment thread batch_infer.py
@@ -70,7 +70,7 @@ def main():
parser.add_argument("--num_workers", type=int, default=0, help="Number of workers for data loading")
parser.add_argument("--output_dir", type=str, default=None,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True

@@ -127,8 +127,8 @@ def render_scene(camera_config: CameraConfig, output_image_path: str, output_obj
parser.add_argument('--mesh_path', type=str,
help='Path to mesh file. If not provided, a temporary directory will be used',
default=None)
Copy link
Copy Markdown

@xuanduong2329-source xuanduong2329-source Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #12

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.

fix: --save_video and --dump_blend CLI flags are always enabled due to conflicting argparse defaults

2 participants