mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-10 23:01:59 +02:00
[nodes] RenderAnimatedCamera: clean up
This commit is contained in:
parent
f8141796f3
commit
fdf45fa6f4
2 changed files with 193 additions and 213 deletions
|
@ -8,32 +8,17 @@ currentDir = os.path.dirname(os.path.abspath(__file__))
|
|||
class RenderAnimatedCamera(desc.CommandLineNode):
|
||||
commandLine = '{blenderPathValue} -b --python {scriptPathValue} -- {allParams}'
|
||||
|
||||
category = 'Rendition'
|
||||
category = 'Export'
|
||||
documentation = '''
|
||||
The goal of this node is to make a render of the sfmData a Blender scene using Blender's API.
|
||||
It supports both Point Clouds (.abc) and Meshes (.obj) and can use a background image of you use undistorted images.
|
||||
We have several inputs:
|
||||
**blenderPath points to the blender executable
|
||||
**scriptPath point to the script containing the code.
|
||||
**sfMCameraPath point to the AnimatedCamera we are going to be tracking.
|
||||
**useBackground determines if you want to use images as a background.
|
||||
**undistortedImages path toward the images you can use as background.
|
||||
**sfMData the data you want to render.
|
||||
(point cloud)
|
||||
**pointCloudDensity changes the density of the point cloud rendered.
|
||||
**particleSize changes the size of each point in the point cloud rendered.
|
||||
**particleColor changes the color of each point in the point cloud rendered.
|
||||
(Mesh)
|
||||
**edgeColor is the color of the outline of the mesh rendered.
|
||||
**outputFormat is the video format we want to export of rendition in.
|
||||
**outputPath point to where is video is going to be saved.
|
||||
This node makes a rendering of the sfmData scene through an animated camera using the Blender rendering engine.
|
||||
It supports both Point Clouds (.abc) and Meshes (.obj).
|
||||
'''
|
||||
|
||||
inputs = [
|
||||
desc.File(
|
||||
name='blenderPath',
|
||||
label='Blender Path',
|
||||
description='''Path to blender binary.''',
|
||||
description='''Path to blender executable''',
|
||||
value=os.environ.get('BLENDER',"C:/Program Files/Blender Foundation/Blender 2.91/blender.exe"),
|
||||
uid=[],
|
||||
group='',
|
||||
|
@ -41,93 +26,102 @@ class RenderAnimatedCamera(desc.CommandLineNode):
|
|||
desc.File(
|
||||
name='scriptPath',
|
||||
label='Script Path',
|
||||
description='''Path to the script in the project.''',
|
||||
description='''Path to the internal script for rendering in Blender''',
|
||||
value=os.path.join(currentDir, 'scripts' ,'renderAnimatedCameraInBlender.py'),
|
||||
uid=[],
|
||||
group='',
|
||||
),
|
||||
desc.File(
|
||||
name='sfMCameraPath',
|
||||
label='Camera Path',
|
||||
description='''Input Camera path from the sfm.''',
|
||||
name='sfmCameraPath',
|
||||
label='SfmData with Animated Camera',
|
||||
description='''SfmData with the animated camera to render''',
|
||||
value='',
|
||||
uid=[0],
|
||||
),
|
||||
desc.File(
|
||||
name='model',
|
||||
label='Model',
|
||||
description='Point Cloud or Mesh used in the rendering',
|
||||
value='',
|
||||
uid=[0],
|
||||
),
|
||||
desc.BoolParam(
|
||||
name='useBackground',
|
||||
label='Display Background',
|
||||
description='Tick if you want to use original image dataset as background',
|
||||
description='Use the undistorted images as background',
|
||||
value=True,
|
||||
uid=[0],
|
||||
),
|
||||
desc.File(
|
||||
name='undistortedImages',
|
||||
label='Images Folder',
|
||||
description='''Input the processed images.''',
|
||||
label='Undistorted Images Folder',
|
||||
description='''Input folder with the undistorted images''',
|
||||
value='',
|
||||
uid=[0],
|
||||
enabled=lambda node: node.displayBackground.useBackground.value,
|
||||
enabled=lambda node: node.useBackground.value,
|
||||
),
|
||||
desc.File(
|
||||
name='sfMData',
|
||||
label='SFM Data',
|
||||
description='''Input the previously used SFM Data.''',
|
||||
value='',
|
||||
uid=[0],
|
||||
desc.GroupAttribute(
|
||||
name="pointCloudParams",
|
||||
label="Point Cloud Settings",
|
||||
group=None,
|
||||
enabled=lambda node: node.model.value.lower().endswith('.abc'),
|
||||
description="Setting of the render if we use a Point Cloud",
|
||||
groupDesc=[
|
||||
desc.FloatParam(
|
||||
name='pointCloudDensity',
|
||||
label='Density',
|
||||
description='''Reduce the points density for the point cloud rendering''',
|
||||
value=0.25,
|
||||
range=(0.01, 0.5, 0.01),
|
||||
uid=[0],
|
||||
),
|
||||
desc.FloatParam(
|
||||
name='particleSize',
|
||||
label='Particle Size',
|
||||
description='''Scale of particles used to show the point cloud''',
|
||||
value=0.1,
|
||||
range=(0.01, 1, 0.01),
|
||||
uid=[0],
|
||||
),
|
||||
desc.ChoiceParam(
|
||||
name='particleColor',
|
||||
label='Particle Color',
|
||||
description='''Color of particles used to show the point cloud''',
|
||||
value='Red',
|
||||
values=['Grey', 'White', 'Red', 'Green', 'Magenta'],
|
||||
exclusive=True,
|
||||
uid=[0],
|
||||
joinChar=',',
|
||||
),
|
||||
]
|
||||
),
|
||||
desc.GroupAttribute(
|
||||
name="meshParams",
|
||||
label="Mesh Settings",
|
||||
group=None,
|
||||
enabled=lambda node: node.model.value.lower().endswith('.obj'),
|
||||
description="Setting of the render if we use a Mesh",
|
||||
groupDesc=[
|
||||
desc.ChoiceParam(
|
||||
name='edgeColor',
|
||||
label='Edge Color',
|
||||
description='''Color of the edges of the rendered object''',
|
||||
value='Red',
|
||||
values=['Grey', 'White', 'Red', 'Green', 'Magenta'],
|
||||
exclusive=True,
|
||||
uid=[0],
|
||||
joinChar=',',
|
||||
),
|
||||
]
|
||||
),
|
||||
desc.GroupAttribute(name="isCloudPoint", label="Point Cloud Settings", group=None, enabled=lambda node: node.sfMData.value.endswith('.abc'), description="Setting of the render if we use a Point Cloud. (SFM Data is .abc)", groupDesc=[
|
||||
desc.FloatParam(
|
||||
name='pointCloudDensity',
|
||||
label='Point Cloud Density',
|
||||
description='''Number of point from the point cloud rendered''',
|
||||
value=0.25,
|
||||
range=(0.01, 0.5, 0.01),
|
||||
uid=[0],
|
||||
enabled=lambda node: node.sfMData.value.endswith('.abc'),
|
||||
),
|
||||
desc.FloatParam(
|
||||
name='particleSize',
|
||||
label='Particle Size',
|
||||
description='''Scale of every particle used to show the point cloud''',
|
||||
value=0.25,
|
||||
range=(0.01, 1, 0.01),
|
||||
uid=[0],
|
||||
enabled=lambda node: node.sfMData.value.endswith('.abc'),
|
||||
),
|
||||
desc.ChoiceParam(
|
||||
name='particleColor',
|
||||
label='Particle Color',
|
||||
description='''Color of every particle used to show the point cloud (SFM Data is .abc)''',
|
||||
value='Red',
|
||||
values=['Grey', 'White', 'Red', 'Green', 'Magenta'],
|
||||
exclusive=True,
|
||||
uid=[0],
|
||||
joinChar=',',
|
||||
enabled=lambda node: node.sfMData.value.endswith('.abc'),
|
||||
),
|
||||
]),
|
||||
desc.GroupAttribute(name="isMesh", label="Mesh Settings", group=None, enabled=lambda node: node.sfMData.value.endswith('.obj'), description="Setting of the render if we use a Mesh. (SFM Data is .obj)", groupDesc=[
|
||||
desc.ChoiceParam(
|
||||
name='edgeColor',
|
||||
label='Edge Color',
|
||||
description='''Color of the edges of the rendered object (SFM Data is .obj)''',
|
||||
value='Red',
|
||||
values=['Grey', 'White', 'Red', 'Green', 'Magenta'],
|
||||
exclusive=True,
|
||||
uid=[0],
|
||||
joinChar=',',
|
||||
enabled=lambda node: node.sfMData.value.endswith('.obj'),
|
||||
),
|
||||
]),
|
||||
desc.ChoiceParam(
|
||||
name='outputFormat',
|
||||
label='Output Format',
|
||||
name='videoFormat',
|
||||
label='Video Format',
|
||||
description='''Choose the format of the output among this list of supported format''',
|
||||
value='mkv',
|
||||
values=['mkv', 'mp4', 'mov', 'avi'],
|
||||
exclusive=True,
|
||||
uid=[0],
|
||||
joinChar=',',
|
||||
),
|
||||
]
|
||||
|
||||
|
@ -135,7 +129,7 @@ class RenderAnimatedCamera(desc.CommandLineNode):
|
|||
desc.File(
|
||||
name='outputPath',
|
||||
label='Output Path',
|
||||
description='''Output folder.''',
|
||||
description='''Output Folder''',
|
||||
value=desc.Node.internalFolder,
|
||||
uid=[],
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue