mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-05 20:31:56 +02:00
[blender] preview: add range arguments for parallelization
This commit is contained in:
parent
15151bab52
commit
74d1a9091e
1 changed files with 22 additions and 1 deletions
|
@ -22,6 +22,14 @@ def createParser():
|
||||||
"--cameras", metavar='FILE', required=True,
|
"--cameras", metavar='FILE', required=True,
|
||||||
help="sfmData with the animated camera.",
|
help="sfmData with the animated camera.",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--rangeStart", type=int, required=False,
|
||||||
|
help="Range start for processing views. Set to -1 to process all views.",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--rangeSize", type=int, required=False,
|
||||||
|
help="Range size for processing views.",
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--useBackground", type=lambda x: (str(x).lower() == 'true'), required=True,
|
"--useBackground", type=lambda x: (str(x).lower() == 'true'), required=True,
|
||||||
help="Display the background image or not.",
|
help="Display the background image or not.",
|
||||||
|
@ -328,8 +336,21 @@ def main():
|
||||||
color = palette[args.particleColor]
|
color = palette[args.particleColor]
|
||||||
setupPointCloudShading(sceneObj, color, args.particleSize)
|
setupPointCloudShading(sceneObj, color, args.particleSize)
|
||||||
|
|
||||||
|
print("Retrieve range")
|
||||||
|
rangeStart = args.rangeStart if args.rangeStart else -1
|
||||||
|
rangeSize = args.rangeSize if args.rangeSize else -1
|
||||||
|
if rangeStart != -1:
|
||||||
|
if rangeStart < 0 or rangeSize < 0 or rangeStart > len(views):
|
||||||
|
print("Invalid range")
|
||||||
|
return 0
|
||||||
|
if rangeStart + rangeSize > len(views):
|
||||||
|
rangeSize = len(views) - rangeStart
|
||||||
|
else:
|
||||||
|
rangeStart = 0
|
||||||
|
rangeSize = len(views)
|
||||||
|
|
||||||
print("Render viewpoints")
|
print("Render viewpoints")
|
||||||
for view in views:
|
for view in views[rangeStart:rangeStart+rangeSize]:
|
||||||
intrinsic = getFromId(intrinsics, 'intrinsicId', view['intrinsicId'])
|
intrinsic = getFromId(intrinsics, 'intrinsicId', view['intrinsicId'])
|
||||||
if not intrinsic:
|
if not intrinsic:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue