[3d] move default values of backgroundColor, LightIntensity, LightMaximum, LightMinimum, LightStep to settings panel (#3536)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Terry Jia
2025-04-20 23:08:23 -04:00
committed by GitHub
parent ebf3c0c049
commit 40d08a890d
18 changed files with 230 additions and 6 deletions

View File

@@ -21,9 +21,9 @@
<Slider
v-model="lightIntensity"
class="w-full"
:min="1"
:max="20"
:step="1"
:min="lightIntensityMinimum"
:max="lightIntensityMaximum"
:step="lightAdjustmentIncrement"
@change="updateLightIntensity"
/>
</div>
@@ -38,6 +38,7 @@ import Slider from 'primevue/slider'
import { onMounted, onUnmounted, ref, watch } from 'vue'
import { t } from '@/i18n'
import { useSettingStore } from '@/stores/settingStore'
const vTooltip = Tooltip
@@ -54,6 +55,16 @@ const lightIntensity = ref(props.lightIntensity)
const showLightIntensityButton = ref(props.showLightIntensityButton)
const showLightIntensity = ref(false)
const lightIntensityMaximum = useSettingStore().get(
'Comfy.Load3D.LightIntensityMaximum'
)
const lightIntensityMinimum = useSettingStore().get(
'Comfy.Load3D.LightIntensityMinimum'
)
const lightAdjustmentIncrement = useSettingStore().get(
'Comfy.Load3D.LightAdjustmentIncrement'
)
watch(
() => props.lightIntensity,
(newValue) => {

View File

@@ -38,6 +38,16 @@ useExtensionService().registerExtension({
defaultValue: true,
experimental: true
},
{
id: 'Comfy.Load3D.BackgroundColor',
category: ['3D', 'Scene', 'Initial Background Color'],
name: 'Initial Background Color',
tooltip:
'Controls the default background color of the 3D scene. This setting determines the background appearance when a new 3D widget is created, but can be adjusted individually for each widget after creation.',
type: 'color',
defaultValue: '282828',
experimental: true
},
{
id: 'Comfy.Load3D.CameraType',
category: ['3D', 'Camera', 'Initial Camera Type'],
@@ -48,6 +58,51 @@ useExtensionService().registerExtension({
options: ['perspective', 'orthographic'],
defaultValue: 'perspective',
experimental: true
},
{
id: 'Comfy.Load3D.LightIntensity',
category: ['3D', 'Light', 'Initial Light Intensity'],
name: 'Initial Light Intensity',
tooltip:
'Sets the default brightness level of lighting in the 3D scene. This value determines how intensely lights illuminate objects when a new 3D widget is created, but can be adjusted individually for each widget after creation.',
type: 'number',
defaultValue: 3,
experimental: true
},
{
id: 'Comfy.Load3D.LightIntensityMaximum',
category: ['3D', 'Light', 'Light Intensity Maximum'],
name: 'Light Intensity Maximum',
tooltip:
'Sets the maximum allowable light intensity value for 3D scenes. This defines the upper brightness limit that can be set when adjusting lighting in any 3D widget.',
type: 'number',
defaultValue: 10,
experimental: true
},
{
id: 'Comfy.Load3D.LightIntensityMinimum',
category: ['3D', 'Light', 'Light Intensity Minimum'],
name: 'Light Intensity Minimum',
tooltip:
'Sets the minimum allowable light intensity value for 3D scenes. This defines the lower brightness limit that can be set when adjusting lighting in any 3D widget.',
type: 'number',
defaultValue: 1,
experimental: true
},
{
id: 'Comfy.Load3D.LightAdjustmentIncrement',
category: ['3D', 'Light', 'Light Adjustment Increment'],
name: 'Light Adjustment Increment',
tooltip:
'Controls the increment size when adjusting light intensity in 3D scenes. A smaller step value allows for finer control over lighting adjustments, while a larger value results in more noticeable changes per adjustment.',
type: 'slider',
attrs: {
min: 0.1,
max: 1,
step: 0.1
},
defaultValue: 0.5,
experimental: true
}
],
getCustomWidgets() {

View File

@@ -91,12 +91,18 @@ class Load3DConfiguration {
this.load3d.togglePreview(showPreview)
const bgColor = this.load3d.loadNodeProperty('Background Color', '#282828')
const bgColor = this.load3d.loadNodeProperty(
'Background Color',
'#' + useSettingStore().get('Comfy.Load3D.BackgroundColor')
)
this.load3d.setBackgroundColor(bgColor)
const lightIntensity: number = Number(
this.load3d.loadNodeProperty('Light Intensity', 5)
this.load3d.loadNodeProperty(
'Light Intensity',
useSettingStore().get('Comfy.Load3D.LightIntensity')
)
)
this.load3d.setLightIntensity(lightIntensity)

View File

@@ -726,7 +726,8 @@
"Load 3D": "Load 3D",
"Camera": "Camera",
"Scene": "Scene",
"3D": "3D"
"3D": "3D",
"Light": "Light"
},
"serverConfigItems": {
"listen": {

View File

@@ -108,6 +108,10 @@
"Hidden": "Hidden"
}
},
"Comfy_Load3D_BackgroundColor": {
"name": "Initial Background Color",
"tooltip": "Controls the default background color of the 3D scene. This setting determines the background appearance when a new 3D widget is created, but can be adjusted individually for each widget after creation."
},
"Comfy_Load3D_CameraType": {
"name": "Initial Camera Type",
"tooltip": "Controls whether the camera is perspective or orthographic by default when a new 3D widget is created. This default can still be toggled individually for each widget after creation.",
@@ -116,6 +120,22 @@
"orthographic": "orthographic"
}
},
"Comfy_Load3D_LightAdjustmentIncrement": {
"name": "Light Adjustment Increment",
"tooltip": "Controls the increment size when adjusting light intensity in 3D scenes. A smaller step value allows for finer control over lighting adjustments, while a larger value results in more noticeable changes per adjustment."
},
"Comfy_Load3D_LightIntensity": {
"name": "Initial Light Intensity",
"tooltip": "Sets the default brightness level of lighting in the 3D scene. This value determines how intensely lights illuminate objects when a new 3D widget is created, but can be adjusted individually for each widget after creation."
},
"Comfy_Load3D_LightIntensityMaximum": {
"name": "Light Intensity Maximum",
"tooltip": "Sets the maximum allowable light intensity value for 3D scenes. This defines the upper brightness limit that can be set when adjusting lighting in any 3D widget."
},
"Comfy_Load3D_LightIntensityMinimum": {
"name": "Light Intensity Minimum",
"tooltip": "Sets the minimum allowable light intensity value for 3D scenes. This defines the lower brightness limit that can be set when adjusting lighting in any 3D widget."
},
"Comfy_Load3D_ShowGrid": {
"name": "Initial Grid Visibility",
"tooltip": "Controls whether the grid is visible by default when a new 3D widget is created. This default can still be toggled individually for each widget after creation."

View File

@@ -890,6 +890,7 @@
"Graph": "Gráfico",
"Group": "Grupo",
"Keybinding": "Asignación de Teclas",
"Light": "Claro",
"Link": "Enlace",
"LinkRelease": "Liberación de Enlace",
"LiteGraph": "Lite Graph",

View File

@@ -108,6 +108,10 @@
"Straight": "Recto"
}
},
"Comfy_Load3D_BackgroundColor": {
"name": "Color de fondo inicial",
"tooltip": "Controla el color de fondo predeterminado de la escena 3D. Esta configuración determina la apariencia del fondo cuando se crea un nuevo widget 3D, pero puede ajustarse individualmente para cada widget después de su creación."
},
"Comfy_Load3D_CameraType": {
"name": "Tipo de Cámara",
"options": {
@@ -116,6 +120,22 @@
},
"tooltip": "Controla si la cámara es perspectiva u ortográfica por defecto cuando se crea un nuevo widget 3D. Este valor predeterminado aún puede ser alternado individualmente para cada widget después de su creación."
},
"Comfy_Load3D_LightAdjustmentIncrement": {
"name": "Incremento de ajuste de luz",
"tooltip": "Controla el tamaño del incremento al ajustar la intensidad de la luz en escenas 3D. Un valor de paso más pequeño permite un control más preciso sobre los ajustes de iluminación, mientras que un valor más grande resulta en cambios más notorios por cada ajuste."
},
"Comfy_Load3D_LightIntensity": {
"name": "Intensidad Inicial de la Luz",
"tooltip": "Establece el nivel de brillo predeterminado de la iluminación en la escena 3D. Este valor determina cuán intensamente las luces iluminan los objetos cuando se crea un nuevo widget 3D, pero puede ajustarse individualmente para cada widget después de la creación."
},
"Comfy_Load3D_LightIntensityMaximum": {
"name": "Intensidad Máxima de Luz",
"tooltip": "Establece el valor máximo permitido de intensidad de luz para escenas 3D. Esto define el límite superior de brillo que se puede ajustar al modificar la iluminación en cualquier widget 3D."
},
"Comfy_Load3D_LightIntensityMinimum": {
"name": "Intensidad de luz mínima",
"tooltip": "Establece el valor mínimo permitido de intensidad de luz para escenas 3D. Esto define el límite inferior de brillo que se puede ajustar al modificar la iluminación en cualquier widget 3D."
},
"Comfy_Load3D_ShowGrid": {
"name": "Mostrar Cuadrícula",
"tooltip": "Cambiar para mostrar cuadrícula por defecto"

View File

@@ -890,6 +890,7 @@
"Graph": "Graphique",
"Group": "Groupe",
"Keybinding": "Raccourci Clavier",
"Light": "Clair",
"Link": "Lien",
"LinkRelease": "Libération de Lien",
"LiteGraph": "Lite Graph",

View File

@@ -108,6 +108,10 @@
"Straight": "Droit"
}
},
"Comfy_Load3D_BackgroundColor": {
"name": "Couleur de fond initiale",
"tooltip": "Contrôle la couleur de fond par défaut de la scène 3D. Ce paramètre détermine l'apparence du fond lors de la création d'un nouveau widget 3D, mais peut être ajusté individuellement pour chaque widget après la création."
},
"Comfy_Load3D_CameraType": {
"name": "Type de Caméra",
"options": {
@@ -116,6 +120,22 @@
},
"tooltip": "Contrôle si la caméra est en perspective ou orthographique par défaut lorsqu'un nouveau widget 3D est créé. Ce défaut peut toujours être basculé individuellement pour chaque widget après sa création."
},
"Comfy_Load3D_LightAdjustmentIncrement": {
"name": "Incrément d'ajustement de la lumière",
"tooltip": "Contrôle la taille de l'incrément lors de l'ajustement de l'intensité lumineuse dans les scènes 3D. Une valeur de pas plus petite permet un contrôle plus précis des ajustements de lumière, tandis qu'une valeur plus grande entraîne des changements plus visibles à chaque ajustement."
},
"Comfy_Load3D_LightIntensity": {
"name": "Intensité lumineuse initiale",
"tooltip": "Définit le niveau de luminosité par défaut de léclairage dans la scène 3D. Cette valeur détermine lintensité avec laquelle les lumières illuminent les objets lors de la création dun nouveau widget 3D, mais peut être ajustée individuellement pour chaque widget après la création."
},
"Comfy_Load3D_LightIntensityMaximum": {
"name": "Intensité lumineuse maximale",
"tooltip": "Définit la valeur maximale autorisée pour lintensité lumineuse dans les scènes 3D. Cela fixe la limite supérieure de luminosité pouvant être réglée lors de lajustement de léclairage dans tout widget 3D."
},
"Comfy_Load3D_LightIntensityMinimum": {
"name": "Intensité lumineuse minimale",
"tooltip": "Définit la valeur minimale autorisée de lintensité lumineuse pour les scènes 3D. Cela définit la limite inférieure de luminosité pouvant être réglée lors de lajustement de léclairage dans tout widget 3D."
},
"Comfy_Load3D_ShowGrid": {
"name": "Afficher la Grille",
"tooltip": "Basculer pour afficher la grille par défaut"

View File

@@ -890,6 +890,7 @@
"Graph": "グラフ",
"Group": "グループ",
"Keybinding": "キー割り当て",
"Light": "ライト",
"Link": "リンク",
"LinkRelease": "リンク解除",
"LiteGraph": "Lite Graph",

View File

@@ -108,6 +108,10 @@
"Straight": "ストレート"
}
},
"Comfy_Load3D_BackgroundColor": {
"name": "初期背景色",
"tooltip": "3Dシーンのデフォルト背景色を設定します。この設定は新しい3Dウィジェット作成時の背景の見た目を決定しますが、作成後に各ウィジェットごとに個別に調整できます。"
},
"Comfy_Load3D_CameraType": {
"name": "カメラタイプ",
"options": {
@@ -116,6 +120,22 @@
},
"tooltip": "新しい3Dウィジェットが作成されたときに、デフォルトでカメラが透視投影か平行投影かを制御します。このデフォルトは、作成後に各ウィジェットごとに個別に切り替えることができます。"
},
"Comfy_Load3D_LightAdjustmentIncrement": {
"name": "ライト調整増分",
"tooltip": "3Dシーンでライトの強度を調整する際の増分サイズを制御します。ステップ値が小さいほど、照明調整をより細かく制御でき、大きい値では1回の調整ごとにより顕著な変化が得られます。"
},
"Comfy_Load3D_LightIntensity": {
"name": "初期ライト強度",
"tooltip": "3Dシーン内の照明のデフォルトの明るさレベルを設定します。この値は新しい3Dウィジェット作成時にライトがオブジェクトをどれだけ強く照らすかを決定しますが、作成後に各ウィジェットごとに個別に調整できます。"
},
"Comfy_Load3D_LightIntensityMaximum": {
"name": "最大光度",
"tooltip": "3Dシーンで許可される最大光度値を設定します。これは、3Dウィジェットで照明を調整する際に設定できる明るさの上限を定義します。"
},
"Comfy_Load3D_LightIntensityMinimum": {
"name": "光の強度の最小値",
"tooltip": "3Dシーンで許可される光の強度の最小値を設定します。これは、3Dウィジェットで照明を調整する際に設定できる明るさの下限を定義します。"
},
"Comfy_Load3D_ShowGrid": {
"name": "グリッドを表示",
"tooltip": "デフォルトでグリッドを表示するには切り替えます"

View File

@@ -890,6 +890,7 @@
"Graph": "그래프",
"Group": "그룹",
"Keybinding": "키 바인딩",
"Light": "라이트",
"Link": "링크",
"LinkRelease": "링크 해제",
"LiteGraph": "LiteGraph",

View File

@@ -108,6 +108,10 @@
"Straight": "직선"
}
},
"Comfy_Load3D_BackgroundColor": {
"name": "초기 배경색",
"tooltip": "3D 장면의 기본 배경색을 설정합니다. 이 설정은 새 3D 위젯이 생성될 때 배경의 모양을 결정하지만, 생성 후 각 위젯별로 개별적으로 조정할 수 있습니다."
},
"Comfy_Load3D_CameraType": {
"name": "카메라 유형",
"options": {
@@ -116,6 +120,22 @@
},
"tooltip": "새로운 3D 위젯이 생성될 때 카메라가 기본적으로 원근법 또는 직교법을 사용하는지를 제어합니다. 이 기본값은 생성 후 각 위젯별로 개별적으로 전환할 수 있습니다."
},
"Comfy_Load3D_LightAdjustmentIncrement": {
"name": "조명 조정 증가량",
"tooltip": "3D 장면에서 조명 강도를 조정할 때 증가하는 크기를 제어합니다. 값이 작을수록 조명을 더 세밀하게 조정할 수 있고, 값이 클수록 한 번에 더 눈에 띄는 변화가 발생합니다."
},
"Comfy_Load3D_LightIntensity": {
"name": "초기 조명 강도",
"tooltip": "3D 장면에서 조명의 기본 밝기 수준을 설정합니다. 이 값은 새 3D 위젯이 생성될 때 조명이 오브젝트를 얼마나 강하게 비추는지 결정하지만, 생성 후 각 위젯별로 개별적으로 조정할 수 있습니다."
},
"Comfy_Load3D_LightIntensityMaximum": {
"name": "최대 조명 강도",
"tooltip": "3D 장면에서 허용되는 최대 조명 강도 값을 설정합니다. 이는 모든 3D 위젯에서 조명을 조정할 때 설정할 수 있는 밝기의 상한선을 정의합니다."
},
"Comfy_Load3D_LightIntensityMinimum": {
"name": "최소 광원 세기",
"tooltip": "3D 장면에서 허용되는 최소 광원 세기 값을 설정합니다. 이는 모든 3D 위젯에서 조명을 조정할 때 설정할 수 있는 밝기의 하한을 정의합니다."
},
"Comfy_Load3D_ShowGrid": {
"name": "그리드 표시",
"tooltip": "기본적으로 그리드를 표시하도록 전환"

View File

@@ -890,6 +890,7 @@
"Graph": "Граф",
"Group": "Группа",
"Keybinding": "Сочетание клавиш",
"Light": "Светлый",
"Link": "Ссылка",
"LinkRelease": "Освобождение ссылки",
"LiteGraph": "Lite Graph",

View File

@@ -108,6 +108,10 @@
"Straight": "Прямой"
}
},
"Comfy_Load3D_BackgroundColor": {
"name": "Начальный цвет фона",
"tooltip": "Управляет цветом фона по умолчанию для 3D-сцены. Этот параметр определяет внешний вид фона при создании нового 3D-виджета, но может быть изменён индивидуально для каждого виджета после создания."
},
"Comfy_Load3D_CameraType": {
"name": "Тип камеры",
"options": {
@@ -116,6 +120,22 @@
},
"tooltip": "Управляет тем, является ли камера перспективной или ортографической по умолчанию при создании нового 3D-виджета. Это значение по умолчанию все еще может быть переключено индивидуально для каждого виджета после его создания."
},
"Comfy_Load3D_LightAdjustmentIncrement": {
"name": "Шаг регулировки освещения",
"tooltip": "Определяет размер шага при регулировке интенсивности освещения в 3D-сценах. Меньшее значение шага позволяет более точно настраивать освещение, а большее значение приводит к более заметным изменениям при каждой регулировке."
},
"Comfy_Load3D_LightIntensity": {
"name": "Начальная интенсивность освещения",
"tooltip": "Устанавливает уровень яркости освещения по умолчанию в 3D-сцене. Это значение определяет, насколько сильно источники света освещают объекты при создании нового 3D-виджета, но может быть изменено для каждого виджета отдельно после создания."
},
"Comfy_Load3D_LightIntensityMaximum": {
"name": "Максимальная интенсивность света",
"tooltip": "Устанавливает максимальное допустимое значение интенсивности света для 3D-сцен. Определяет верхний предел яркости, который можно задать при настройке освещения в любом 3D-виджете."
},
"Comfy_Load3D_LightIntensityMinimum": {
"name": "Минимальная интенсивность света",
"tooltip": "Устанавливает минимально допустимое значение интенсивности света для 3D-сцен. Определяет нижний предел яркости, который можно установить при настройке освещения в любом 3D-виджете."
},
"Comfy_Load3D_ShowGrid": {
"name": "Показать сетку",
"tooltip": "Переключиться, чтобы показывать сетку по умолчанию"

View File

@@ -890,6 +890,7 @@
"Graph": "画面",
"Group": "组节点",
"Keybinding": "快捷键",
"Light": "浅色",
"Link": "连线",
"LinkRelease": "释放链接",
"LiteGraph": "画面",

View File

@@ -108,6 +108,10 @@
"Straight": "直角线"
}
},
"Comfy_Load3D_BackgroundColor": {
"name": "初始背景颜色",
"tooltip": "控制3D场景的默认背景颜色。此设置决定新建3D组件时的背景外观但每个组件在创建后都可以单独调整。"
},
"Comfy_Load3D_CameraType": {
"name": "摄像机类型",
"options": {
@@ -116,6 +120,22 @@
},
"tooltip": "控制创建新的3D小部件时默认的相机是透视还是正交。这个默认设置仍然可以在创建后为每个小部件单独切换。"
},
"Comfy_Load3D_LightAdjustmentIncrement": {
"name": "光照调整步长",
"tooltip": "控制在3D场景中调整光照强度时的步长。较小的步长值可以实现更精细的光照调整较大的值则会使每次调整的变化更加明显。"
},
"Comfy_Load3D_LightIntensity": {
"name": "初始光照强度",
"tooltip": "设置3D场景中灯光的默认亮度级别。该数值决定新建3D控件时灯光照亮物体的强度但每个控件在创建后都可以单独调整。"
},
"Comfy_Load3D_LightIntensityMaximum": {
"name": "最大光照强度",
"tooltip": "设置3D场景允许的最大光照强度值。此项定义了在调整任何3D控件照明时可设定的最高亮度上限。"
},
"Comfy_Load3D_LightIntensityMinimum": {
"name": "光照强度下限",
"tooltip": "设置3D场景允许的最小光照强度值。此项定义在调整任何3D控件照明时可设定的最低亮度。"
},
"Comfy_Load3D_ShowGrid": {
"name": "显示网格",
"tooltip": "默认显示网格开关"

View File

@@ -442,6 +442,11 @@ const zSettings = z.object({
'Comfy.MaskEditor.UseDominantAxis': z.boolean(),
'Comfy.Load3D.ShowGrid': z.boolean(),
'Comfy.Load3D.ShowPreview': z.boolean(),
'Comfy.Load3D.BackgroundColor': z.string(),
'Comfy.Load3D.LightIntensity': z.number(),
'Comfy.Load3D.LightIntensityMaximum': z.number(),
'Comfy.Load3D.LightIntensityMinimum': z.number(),
'Comfy.Load3D.LightAdjustmentIncrement': z.number(),
'Comfy.Load3D.CameraType': z.enum(['perspective', 'orthographic']),
'pysssss.SnapToGrid': z.boolean(),
/** VHS setting is used for queue video preview support. */