Skip to content

Commit

Permalink
REMIX-2782: Add light manipulator for CylinderLight
Browse files Browse the repository at this point in the history
  • Loading branch information
nxkb committed Jul 30, 2024
1 parent 697d02c commit 2600ef1
Show file tree
Hide file tree
Showing 15 changed files with 647 additions and 364 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Create 2024.4.0-RC.3 build
- REMIX-2783: Added light manipulator for CylinderLight

### Changed
- Updated repo tools + added public version of repo lint
Expand Down
2 changes: 1 addition & 1 deletion source/apps/lightspeed.app.trex.ingestcraft.kit
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ enabled = [
"lightspeed.trex.viewports.properties_pane.widget-1.0.3",
"lightspeed.trex.viewports.shared.widget-1.2.7",
"lightspeed.trex.waypoint.core-1.1.2",
"lightspeed.ui_scene.light_manipulator-1.0.3",
"lightspeed.ui_scene.light_manipulator-1.0.4",
"omni.flux.asset_importer.core-1.16.6",
"omni.flux.asset_importer.widget-2.5.7",
"omni.flux.commands-1.0.4",
Expand Down
2 changes: 1 addition & 1 deletion source/apps/lightspeed.app.trex.kit
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ enabled = [
"lightspeed.trex.viewports.stagecraft.bundle-1.1.3",
"lightspeed.trex.waypoint.core-1.1.2",
"lightspeed.trex.welcome_pads.stagecraft.models-1.0.3",
"lightspeed.ui_scene.light_manipulator-1.0.3",
"lightspeed.ui_scene.light_manipulator-1.0.4",
"lightspeed.upscale.core-0.1.3",
"omni.flux.asset_importer.core-1.16.6",
"omni.flux.asset_importer.widget-2.5.7",
Expand Down
2 changes: 1 addition & 1 deletion source/apps/lightspeed.app.trex.stagecraft.kit
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ enabled = [
"lightspeed.trex.viewports.stagecraft.bundle-1.1.3",
"lightspeed.trex.waypoint.core-1.1.2",
"lightspeed.trex.welcome_pads.stagecraft.models-1.0.3",
"lightspeed.ui_scene.light_manipulator-1.0.3",
"lightspeed.ui_scene.light_manipulator-1.0.4",
"lightspeed.upscale.core-0.1.3",
"omni.flux.asset_importer.core-1.16.6",
"omni.flux.asset_importer.widget-2.5.7",
Expand Down
2 changes: 1 addition & 1 deletion source/apps/lightspeed.app.trex.texturecraft.kit
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ enabled = [
"lightspeed.trex.viewports.manipulators-1.3.0",
"lightspeed.trex.viewports.properties_pane.widget-1.0.3",
"lightspeed.trex.viewports.shared.widget-1.2.7",
"lightspeed.ui_scene.light_manipulator-1.0.3",
"lightspeed.ui_scene.light_manipulator-1.0.4",
"omni.flux.asset_importer.core-1.16.6",
"omni.flux.asset_importer.widget-2.5.7",
"omni.flux.commands-1.0.4",
Expand Down
2 changes: 1 addition & 1 deletion source/apps/lightspeed.app.trex_dev.kit
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ enabled = [
"lightspeed.trex.viewports.stagecraft.bundle-1.1.3",
"lightspeed.trex.waypoint.core-1.1.2",
"lightspeed.trex.welcome_pads.stagecraft.models-1.0.3",
"lightspeed.ui_scene.light_manipulator-1.0.3",
"lightspeed.ui_scene.light_manipulator-1.0.4",
"lightspeed.upscale.core-0.1.3",
"omni.flux.asset_importer.core-1.16.6",
"omni.flux.asset_importer.widget-2.5.7",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
version = "1.0.3"
version = "1.0.4"
authors = ["Nicolas Kendall-Bar <[email protected]>"]
title = "Omni.UI Scene Sample For Manipulating Select Light"
description = "This example show an 3D manipulator for a selected light"
Expand All @@ -19,7 +19,6 @@ icon = "data/icon.png"
"omni.flux.utils.common" = {}
"omni.kit.commands" = {}
"omni.kit.scene_view.opengl" = {}
"omni.kit.scene_view.opengl" = {}
"omni.ui" = {}
"omni.ui.scene" = {}
"omni.usd" = {}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [1.0.4]
### Added
- Added light manipulator for CylinderLight

## [1.0.3]
### Changed
- Fixed test deps
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
"""
* SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
"""

from __future__ import annotations

from omni.ui import color as cl

# this INTENSITY_SCALE is to make the manipulators a reasonable length with large intensity number
INTENSITY_SCALE = 3.5 # global scaler of how big intensity appears
INTENSITY_MIN = 0.2 # min length to make sure something shows for user to grab on to (twice arrow height)
DIMENSION_MIN = 0.1 # min dimension that you can set a physical light dimension to using the manipulator
# defaults are from: `omni.flux.light_creator.widget/omni/flux/light_creator/widget/setup_ui.py`
DISTANT_LIGHT_INTENSITY = 25
SPHERE_LIGHT_INTENSITY = 100
RECT_LIGHT_INTENSITY = 400
DISK_LIGHT_INTENSITY = 500
CYLINDER_LIGHT_INTENSITY = 140

# Manipulator arrow mesh constants
ARROW_WIDTH = 0.03
ARROW_HEIGHT = 0.1
ARROW_P = [ # points
[ARROW_WIDTH, ARROW_WIDTH, 0],
[-ARROW_WIDTH, ARROW_WIDTH, 0],
[0, 0, ARROW_HEIGHT],
#
[ARROW_WIDTH, -ARROW_WIDTH, 0],
[-ARROW_WIDTH, -ARROW_WIDTH, 0],
[0, 0, ARROW_HEIGHT],
#
[ARROW_WIDTH, ARROW_WIDTH, 0],
[ARROW_WIDTH, -ARROW_WIDTH, 0],
[0, 0, ARROW_HEIGHT],
#
[-ARROW_WIDTH, ARROW_WIDTH, 0],
[-ARROW_WIDTH, -ARROW_WIDTH, 0],
[0, 0, ARROW_HEIGHT],
#
[ARROW_WIDTH, ARROW_WIDTH, 0],
[-ARROW_WIDTH, ARROW_WIDTH, 0],
[-ARROW_WIDTH, -ARROW_WIDTH, 0],
[ARROW_WIDTH, -ARROW_WIDTH, 0],
]

ARROW_VC = [3, 3, 3, 3, 4] # faces
ARROW_VI = list(range(sum(ARROW_VC))) # indices
# length of line almost to tip of arrow but shorter to make sure line doesn't dull point
# when drawn
ARROW_TIP = ARROW_HEIGHT - 0.02

# Style settings, as kwargs
THICKNESS = 1
HOVER_THICKNESS = THICKNESS + 2
COLOR = cl.yellow
HOVER_COLOR = cl.yellow # color for arrows and corner rectangles when hovered
CLEAR_COLOR = cl(0, 0, 0, 0) # the key is that alpha is 0 here
DEFAULT_SHAPE_STYLE = {"thickness": THICKNESS, "color": COLOR}
DEFAULT_ARC_STYLE = {"thickness": THICKNESS, "color": COLOR, "wireframe": True, "sector": False}

SQUARE_WIDTH = 0.06
SQUARE_CENTER_TO_EDGE = 0.5 * SQUARE_WIDTH + 0.01 * THICKNESS
Loading

0 comments on commit 2600ef1

Please sign in to comment.