Skip to content
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

Internal change #337

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions kubric/renderer/blender_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,11 @@ def replace_cryptomatte_hashes_by_asset_index(
new_segmentation_ids = np.zeros_like(segmentation_ids)
for idx, asset in enumerate(assets, start=1):
asset_hash = mm3hash(asset.uid)
new_segmentation_ids[segmentation_ids == asset_hash] = idx
if hasattr(asset, "segmentation_id") and asset.segmentation_id is not None:
uid = asset.segmentation_id
else:
uid = idx
new_segmentation_ids[segmentation_ids == asset_hash] = uid
return new_segmentation_ids


Expand Down Expand Up @@ -472,5 +476,3 @@ def process_rgba(exr_layers, scene): # pylint: disable=unused-argument

def process_rgb(exr_layers, scene): # pylint: disable=unused-argument
return exr_layers["rgba"][..., :3]


Loading