mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 16:58:12 +00:00
Rename get_formats to get_output_formats for engines
This commit is contained in:
@@ -34,7 +34,7 @@ class AERender(BaseRenderEngine):
|
||||
return version
|
||||
|
||||
@classmethod
|
||||
def get_formats(cls):
|
||||
def get_output_formats(cls):
|
||||
# todo: create implementation
|
||||
return []
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class Blender(BaseRenderEngine):
|
||||
return version
|
||||
|
||||
@classmethod
|
||||
def get_formats(cls):
|
||||
def get_output_formats(cls):
|
||||
format_string = cls.get_help().split('Format Options')[-1].split('Animation Playback Options')[0]
|
||||
formats = re.findall(r"'([A-Z_0-9]+)'", format_string)
|
||||
return formats
|
||||
@@ -218,7 +218,7 @@ if __name__ == '__main__':
|
||||
|
||||
print(Blender.full_report())
|
||||
|
||||
# x = pack_blender_files('/Users/brett/Blender Files/temple_animatic.blend')
|
||||
x = Blender.pack_project_file('/Users/brettwilliams/Downloads/barbershop_interior.blend')
|
||||
# print(x)
|
||||
|
||||
# logging.basicConfig(format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S', level=logging.DEBUG)
|
||||
|
||||
@@ -25,19 +25,12 @@ class FFMPEG(BaseRenderEngine):
|
||||
return encoders
|
||||
|
||||
@classmethod
|
||||
def get_formats(cls):
|
||||
def get_output_formats(cls):
|
||||
formats_raw = subprocess.check_output([cls.renderer_path(), '-formats'], stderr=subprocess.DEVNULL).decode('utf-8')
|
||||
pattern = '(?P<type>[DE]{1,2})\s+(?P<name>\S{2,})\s+(?P<description>.*)'
|
||||
formats = [m.groupdict() for m in re.finditer(pattern, formats_raw)]
|
||||
return formats
|
||||
|
||||
@classmethod
|
||||
def full_report(cls):
|
||||
return {'version': cls.version(),
|
||||
'help_text': cls.get_help(),
|
||||
'encoders': cls.get_encoders(),
|
||||
'formats': cls.get_formats()}
|
||||
|
||||
|
||||
class FFMPEGRenderWorker(BaseRenderWorker):
|
||||
|
||||
|
||||
@@ -253,8 +253,8 @@ class BaseRenderEngine(object):
|
||||
return help_doc
|
||||
|
||||
@classmethod
|
||||
def get_formats(cls):
|
||||
raise NotImplementedError("get_formats not implemented")
|
||||
def get_output_formats(cls):
|
||||
raise NotImplementedError(f"get_output_formats not implemented for {cls.__name__}")
|
||||
|
||||
|
||||
class RenderWorkerFactory:
|
||||
|
||||
Reference in New Issue
Block a user