Skip to content

Commit

Permalink
[nodes] Split360Images: custom dynamic node size for chunkable output
Browse files Browse the repository at this point in the history
  • Loading branch information
mugulmd authored and fabiencastan committed Jun 3, 2023
1 parent eb198fb commit db978d4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions meshroom/nodes/aliceVision/LdrToHdrSampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class DividedInputNodeSize(desc.DynamicNodeSize):
def __init__(self, param, divParam):
super(DividedInputNodeSize, self).__init__(param)
self._divParam = divParam

def computeSize(self, node):
s = super(DividedInputNodeSize, self).computeSize(node)
divParam = node.attribute(self._divParam)
Expand Down
18 changes: 18 additions & 0 deletions meshroom/nodes/aliceVision/Split360Images.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,26 @@

from meshroom.core import desc


class Split360InputNodeSize(desc.DynamicNodeSize):
'''
The Split360Images will increase the amount of views in the SfMData.
This class converts the number of input views into the number of split output views.
'''
def computeSize(self, node):
s = super(Split360InputNodeSize, self).computeSize(node)
factor = 0
mode = node.attribute('splitMode')
if mode.value == 'equirectangular':
factor = node.attribute('equirectangularGroup.equirectangularNbSplits').value
elif mode.value == 'dualfisheye':
factor = 2
return s * factor


class Split360Images(desc.AVCommandLineNode):
commandLine = 'aliceVision_split360Images {allParams}'
size = Split360InputNodeSize('input')

category = 'Utils'
documentation = "This node is used to extract multiple images from equirectangular or dualfisheye images."
Expand Down

0 comments on commit db978d4

Please sign in to comment.