A community-maintained Python framework for creating mathematical animations.
Added the option to change color in extract scene. This edits the camera config in the same way as the resolution argument or transparency flag. Inputs can either be strings, 3 digit hex strings, or 6 digit hex strings. In a Unix terminal the hex strings will have to be prepended with a '\'.
Dan Waxman314649c96fb1
diff --git a/extract_scene.py b/extract_scene.pyindex 465b33f34..68356986d 100644--- a/extract_scene.py+++ b/extract_scene.py@@ -16,6 +16,8 @@ from scene.scene import Scenefrom utils.sounds import play_error_soundfrom utils.sounds import play_finish_sound+from colour import Color+HELP_MESSAGE = """Usage:python extract_scene.py <module> [<scene name>]@@ -31,6 +33,7 @@ HELP_MESSAGE = """-t use transperency when exporting images-n specify the number of the animation to start from-r specify a resolution+ -c specify a background color"""SCENE_NOT_FOUND_MESSAGE = """That scene is not in the script@@ -72,6 +75,7 @@ def get_configuration():parser.add_argument("-o", "--output_name")parser.add_argument("-n", "--start_at_animation_number")parser.add_argument("-r", "--resolution")+ parser.add_argument("-c", "--color")args = parser.parse_args()if args.output_name is not None:output_name_root, output_name_ext = os.path.splitext(@@ -135,6 +139,14 @@ def get_configuration():"pixel_width": width,})+ if args.color:+ try:+ config["camera_config"]["background_color"] = Color(args.color)+ except AttributeError as err:+ print("Please use a valid color")+ print(err)+ sys.exit(2)+# If rendering a transparent image/move, make sure the# scene has a background opacity of 0if args.transparent: