-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[nodes] New node "RenderAnimatedCamera" using blender API #1432
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
64da47f
[nodes] adding new node for Animated Camera Rendering (no errors but …
DanielDelaporus a37bdeb
[nodes] Animated Camera Rendering (can't see cloud of point on render)
DanielDelaporus 8299cab
[nodes] Change in export animated cams and improving blender node
DanielDelaporus 9b3f7fa
[node] Adding a density factor to the render node
DanielDelaporus 5bb026a
[node] Adding the rendering of the background image among other
DanielDelaporus 5701f8f
[node] Adding working background and several other feat.
DanielDelaporus 1e2aaff
[node] Adding color particle changes and a lot of comments
DanielDelaporus f814179
[nodes] Adding mesh render with edge detection and changes on the args
DanielDelaporus fdf45fa
[nodes] RenderAnimatedCamera: clean up
fabiencastan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
__version__ = "1.0" | ||
|
||
from meshroom.core import desc | ||
import os.path | ||
|
||
currentDir = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
class RenderAnimatedCamera(desc.CommandLineNode): | ||
commandLine = '{blenderPathValue} -b --python {scriptPathValue} -- {allParams}' | ||
|
||
category = 'Export' | ||
documentation = ''' | ||
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 executable''', | ||
value=os.environ.get('BLENDER',"C:/Program Files/Blender Foundation/Blender 2.91/blender.exe"), | ||
uid=[], | ||
group='', | ||
), | ||
desc.File( | ||
name='scriptPath', | ||
label='Script Path', | ||
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='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='Use the undistorted images as background', | ||
value=True, | ||
uid=[0], | ||
), | ||
desc.File( | ||
name='undistortedImages', | ||
label='Undistorted Images Folder', | ||
description='''Input folder with the undistorted images''', | ||
value='', | ||
uid=[0], | ||
enabled=lambda node: node.useBackground.value, | ||
), | ||
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.ChoiceParam( | ||
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], | ||
), | ||
] | ||
|
||
outputs = [ | ||
desc.File( | ||
name='outputPath', | ||
label='Output Path', | ||
description='''Output Folder''', | ||
value=desc.Node.internalFolder, | ||
uid=[], | ||
) | ||
] |
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add category and documentation variables.