Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dhrogers committed Oct 31, 2024
1 parent f48c294 commit 165e7e5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
11 changes: 6 additions & 5 deletions examples/scalar-images_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config:
debug: False
verbose: True
depthchannel: depth
output: scalar-images_composite.cdb

Expand All @@ -12,15 +13,15 @@ elements:
- name: p
channel: depth
channelrange: [-1.0, 1.0]
colormap: rainbow
colormap: gray
nancolor: [0, 0, 0, 0]
- name: s1
- name: s0
channel: depth
channelrange: [-1.0, 1.0]
colormap: rainbow
colormap: plasma
nancolor: [0, 0, 0, 0]
- name: s0
- name: s1
channel: depth
channelrange: [-1.0, 1.0]
colormap: gray
colormap: rainbow
nancolor: [0, 0, 0, 0]
19 changes: 17 additions & 2 deletions scripts/cinematic
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,22 @@ class Composite:
for element in config['elements']:
self.elements.append(Element(self, element, config))

# composite
curDepthCompositing = None
aImages = self.elements[0].outputs.images
if True:
for element in self.elements[1:]:
curDepthCompositing = pycinema.filters.DepthCompositing()
curDepthCompositing.inputs.images_a.set(aImages)
curDepthCompositing.inputs.images_b.set(element.outputs.images)
# remember output of compositor
aImages = curDepthCompositing.outputs.images

# write the resulting images to a new cdb
self.writer = pycinema.filters.CinemaDatabaseWriter()
self.writer.inputs.images.set(self.elements[0].output.images, False)
# self.writer.inputs.images.set(self.elements[0].output.images, False)
curDepthCompositing.update()
self.writer.inputs.images.set(curDepthCompositing.outputs.images, False)
self.writer.inputs.path.set(config['config']['output'], False)
self.writer.inputs.ignore.set(['^id', '^camera', '^FILE'], False)
self.writer.inputs.hdf5.set(False, False)
Expand All @@ -56,6 +69,8 @@ class Composite:
class Element:

def __init__(self, composite, element, config):
self.name = element['name']

# query
self.query = pycinema.filters.TableQuery()
self.query.inputs.table.set(composite.reader.outputs.table, False)
Expand Down Expand Up @@ -90,7 +105,7 @@ class Element:
self.colormap.inputs.images.set(self.imReader.outputs.images, False)
self.colormap.inputs.composition_id.set(-1, False)

self.output = self.colormap.outputs
self.outputs = self.colormap.outputs



Expand Down

0 comments on commit 165e7e5

Please sign in to comment.