Skip to content

Commit

Permalink
[nodes] Adding mesh render with edge detection and changes on the args
Browse files Browse the repository at this point in the history
Added the possibility of rendering the output of the meshing node into a edge detection render of the obj. Added the activation and deactivation of the background images as an option. Improving the way the arguments are shown with a conditionnal display of some arguments.
  • Loading branch information
DanielDelaporus committed Jun 2, 2021
1 parent 0ef426a commit 76fe403
Show file tree
Hide file tree
Showing 2 changed files with 250 additions and 121 deletions.
96 changes: 66 additions & 30 deletions meshroom/nodes/blender/RenderAnimatedCamera.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class RenderAnimatedCamera(desc.CommandLineNode):
desc.File(
name='scriptPath',
label='Script Path',
description='''Path to blender binary.''',
description='''Path to the script in the project.''',
value=os.path.join(currentDir, 'scripts' ,'camera_support.py'),
uid=[],
group='',
Expand All @@ -32,52 +32,88 @@ class RenderAnimatedCamera(desc.CommandLineNode):
value='',
uid=[0],
),
desc.BoolParam(
name='useBackground',
label='Display Background',
description='Tick if you want to use original image dataset as background',
value=True,
uid=[0],
),
desc.File(
name='undistortedImages',
label='Images Folder',
description='''Input the processed images.''',
value='',
uid=[0],
enabled=lambda node: node.displayBackground.useBackground.value,
),
desc.File(
name='sfMData',
label='SFM Data',
description='''Input the previously used SFM Data.''',
value='',
uid=[0],
),
desc.FloatParam(
name='cloudPointDensity',
label='Cloud Point Density',
description='''Number of point from the cloud rendered''',
value=0.25,
range=(0.01, 0.5, 0.01),
uid=[0],
),
desc.FloatParam(
name='particleSize',
label='Particle Size',
description='''Scale of every particle used to show the cloud of point''',
value=0.25,
range=(0.01, 1, 0.01),
uid=[0],
),
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 cloud of point''',
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 cloud of point (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='particleColor',
label='Particle Color',
description='''Color of every particle used to show the cloud of point''',
value=['Grey'],
values=['Grey', 'White', 'Red', 'Green', 'Magenta'],
name='outputFormat',
label='Output 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=',',
),
desc.File(
name='undistortedImages',
label='Images Folder',
description='''Input the processed images.''',
value='',
uid=[0],
),
]

outputs = [
desc.File(
name='outputPath',
label='Output Video',
label='Output Path',
description='''Output folder.''',
value=desc.Node.internalFolder, # PLACE HOLDER TO CHANGE
uid=[],
Expand Down
Loading

0 comments on commit 76fe403

Please sign in to comment.