Skip to content

Commit

Permalink
fix(octree mapping): Get scene files for all phases (2, 3, and 5)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelkp authored and mostaphaRoudsari committed Feb 13, 2022
1 parent d944294 commit 78b0fb8
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions honeybee_radiance_folder/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,11 +640,12 @@ def octree_scene_mapping(self):
matrix. These files can be used to create the octree for each specific state."""

scene_mapping = []
# TODO: we should probably check if 2 phase is possible, i.e., check if there are
# static apertures and non-BSDF aperture groups.
two_phase, three_phase, five_phase = [], [], []

# two phase
# static apertures
if self.has_aperture:
scene_mapping.append(
two_phase.append(
{
'identifier': '__static_apertures__',
'scene_files': self.scene_files() + self.aperture_files() + \
Expand All @@ -662,7 +663,7 @@ def octree_scene_mapping(self):
for state in ap_states:
if not 'tmtx' in state:
pattern = '%s$' % state['default'].replace('./', '')
scene_mapping.append(
two_phase.append(
{
'identifier': state['identifier'],
'scene_files': self.scene_files() + \
Expand All @@ -677,6 +678,37 @@ def octree_scene_mapping(self):
self.aperture_group_files_black(exclude=aperture_group)
}
)
else:
# five phase
pattern = '%s$' % state['direct'].replace('./', '')
five_phase.append(
{
'identifier': state['identifier'],
'scene_files_direct': self.scene_files(black_out=True) + \
self.aperture_files(black_out=True) + \
self._find_files(self.aperture_group_folder(full=True),
pattern) + \
self.aperture_group_files_black(exclude=aperture_group)
}
)

# three phase
three_phase.append(
{
'identifier': 'default',
'scene_files': self.scene_files() + self.aperture_files(),
'scene_files_direct': self.scene_files(black_out=True) + \
self.aperture_files(black_out=True)
}
)

scene_mapping.extend(
[
{'two-phase': two_phase},
{'three-phase': three_phase},
{'five-phase': five_phase}
]
)

scene_mapping_file = os.path.join(self.folder, 'scene_mapping.json')

Expand Down

0 comments on commit 78b0fb8

Please sign in to comment.