@@ -77,46 +77,48 @@ def init_output_directories(self, scene_name):
77
77
)
78
78
79
79
if file_writer_config ["write_to_movie" ]:
80
- if file_writer_config ["video_dir" ]:
81
- if not file_writer_config ["custom_folders" ]:
82
- movie_dir = guarantee_existence (
83
- os .path .join (
84
- file_writer_config ["video_dir" ],
85
- module_directory ,
86
- self .get_resolution_directory (),
87
- )
88
- )
89
- else :
90
- movie_dir = guarantee_existence (
91
- os .path .join (file_writer_config ["video_dir" ])
92
- )
93
- self .movie_file_path = os .path .join (
94
- movie_dir ,
95
- add_extension_if_not_present (
96
- default_name , file_writer_config ["movie_file_extension" ]
97
- ),
98
- )
99
- self .gif_file_path = os .path .join (
100
- movie_dir ,
101
- add_extension_if_not_present (default_name , GIF_FILE_EXTENSION ),
102
- )
80
+ pass
81
+ if file_writer_config ["video_dir" ]:
103
82
if not file_writer_config ["custom_folders" ]:
104
- self . partial_movie_directory = guarantee_existence (
83
+ movie_dir = guarantee_existence (
105
84
os .path .join (
106
- movie_dir ,
107
- "partial_movie_files" ,
108
- default_name ,
85
+ file_writer_config [ "video_dir" ] ,
86
+ module_directory ,
87
+ self . get_resolution_directory () ,
109
88
)
110
89
)
111
90
else :
112
- self .partial_movie_directory = guarantee_existence (
113
- os .path .join (
114
- file_writer_config ["media_dir" ],
115
- "temp_files" ,
116
- "partial_movie_files" ,
117
- default_name ,
118
- )
91
+ movie_dir = guarantee_existence (
92
+ os .path .join (file_writer_config ["video_dir" ])
119
93
)
94
+ self .movie_file_path = os .path .join (
95
+ movie_dir ,
96
+ add_extension_if_not_present (
97
+ default_name , file_writer_config ["movie_file_extension" ]
98
+ ),
99
+ )
100
+ self .gif_file_path = os .path .join (
101
+ movie_dir ,
102
+ add_extension_if_not_present (default_name , GIF_FILE_EXTENSION ),
103
+ )
104
+ # The partial movie directory has to be set even if we do not write to movie
105
+ if not file_writer_config ["custom_folders" ]:
106
+ self .partial_movie_directory = guarantee_existence (
107
+ os .path .join (
108
+ movie_dir ,
109
+ "partial_movie_files" ,
110
+ default_name ,
111
+ )
112
+ )
113
+ else :
114
+ self .partial_movie_directory = guarantee_existence (
115
+ os .path .join (
116
+ file_writer_config ["media_dir" ],
117
+ "temp_files" ,
118
+ "partial_movie_files" ,
119
+ default_name ,
120
+ )
121
+ )
120
122
121
123
def add_partial_movie_file (self , hash_animation ):
122
124
"""Adds a new partial movie file path to scene.partial_movie_files from an hash. This method will compute the path from the hash.
@@ -482,11 +484,14 @@ def is_already_cached(self, hash_invocation):
482
484
:class:`bool`
483
485
Whether the file exists.
484
486
"""
485
- path = os .path .join (
486
- self .partial_movie_directory ,
487
- "{}{}" .format (hash_invocation , self .movie_file_extension ),
488
- )
489
- return os .path .exists (path )
487
+ if hasattr (self ,'partial_movie_directory' ):
488
+ path = os .path .join (
489
+ self .partial_movie_directory ,
490
+ "{}{}" .format (hash_invocation , self .movie_file_extension ),
491
+ )
492
+ return os .path .exists (path )
493
+ else :
494
+ return False # If there is no partial movie directory, then the file is not cached
490
495
491
496
def combine_movie_files (self ):
492
497
"""
0 commit comments