7536 lines · 271.3 KB · JavaScript
RawDownload
//  entityProperties.js////  Created by Ryan Huffman on November 13th, 2014//  Copyright 2014 High Fidelity, Inc.//  Copyright 2020 Vircadia contributors.//  Copyright 2022-2025 Overte e.V.////  Distributed under the Apache License, Version 2.0.//  See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html /* global alert, augmentSpinButtons, clearTimeout, console, document, Element,    EventBridge, JSONEditor, openEventBridge, setTimeout, window, _, $ */ var currentTab = "base"; const DEGREES_TO_RADIANS = Math.PI / 180.0; const UUID_NONE = "{00000000-0000-0000-0000-000000000000}"; const ENTITY_HOST_TYPE_COLOR_DOMAIN = "#afafaf";const ENTITY_HOST_TYPE_COLOR_AVATAR = "#7fdb98";const ENTITY_HOST_TYPE_COLOR_LOCAL = "#f0d769"; const NO_SELECTION = ","; const MAX_TAGS_PER_ROWS = 5; const AUDIO_ATTENUATION_COEFFICIENT_DEFAULT_VALUE = 0.5; const PROPERTY_SPACE_MODE = Object.freeze({    ALL: 0,    LOCAL: 1,    WORLD: 2}); const PROPERTY_SELECTION_VISIBILITY = Object.freeze({    SINGLE_SELECTION: 1,    MULTIPLE_SELECTIONS: 2,    MULTI_DIFF_SELECTIONS: 4,    ANY_SELECTIONS: 7 /* SINGLE_SELECTION | MULTIPLE_SELECTIONS | MULTI_DIFF_SELECTIONS */}); // Multiple-selection behaviorconst PROPERTY_MULTI_DISPLAY_MODE = Object.freeze({    DEFAULT: 0,    /**     * Comma separated values     * Limited for properties with type "string" or "textarea" and readOnly enabled     */    COMMA_SEPARATED_VALUES: 1}); const GROUPS = [    {        id: "base",        label: "ENTITY",        properties: [            {                label: NO_SELECTION,                type: "icon",                icons: ENTITY_TYPE_ICON,                propertyID: "type",                replaceID: "placeholder-property-type",            },            {                label: "Name",                type: "string",                propertyID: "name",                placeholder: "Name",                replaceID: "placeholder-property-name",            },            {                label: "ID",                type: "string",                propertyID: "id",                placeholder: "ID",                readOnly: true,                replaceID: "placeholder-property-id",                multiDisplayMode: PROPERTY_MULTI_DISPLAY_MODE.COMMA_SEPARATED_VALUES,            },            {                label: "Description",                type: "string",                propertyID: "description",            },            {                label: "Parent",                type: "string",                propertyID: "parentID",                buttons: [ { id: "navigateToParentEntity", label: "1", className: "navigation", onClick: navigateToSpecificEntityFromParentID } ],                onChange: parentIDChanged,            },            {                label: "Parent Joint Index",                type: "number",                propertyID: "parentJointIndex",            },            {                label: "",                glyph: "",                type: "bool",                propertyID: "locked",                replaceID: "placeholder-property-locked",            },            {                label: "",                glyph: "",                type: "bool",                propertyID: "visible",                replaceID: "placeholder-property-visible",            },            {                label: "Render Layer",                type: "dropdown",                options: {                    world: "World",                    front: "Front",                    hud: "HUD"                },                propertyID: "renderLayer",            },            {                label: "Primitive Mode",                type: "dropdown",                options: {                    solid: "Solid",                    lines: "Wireframe",                },                propertyID: "primitiveMode",            },            {                label: "Billboard Mode",                type: "dropdown",                options: {                    none: "None",                    yaw: "Yaw",                    full: "Full"                },                propertyID: "billboardMode",            },            {                label: "Mirror Mode",                type: "dropdown",                options: {                    none: "None",                    mirror: "Mirror",                    portal: "Portal"                },                propertyID: "mirrorMode",            },            {                label: "Portal Exit",                type: "string",                propertyID: "portalExitID",                showPropertyRule: { "mirrorMode": "portal" },            },            {                label: "Render With Zones",                type: "multipleZonesSelection",                propertyID: "renderWithZones",            },            {                label: "Tags",                type: "arrayOfStrings",                propertyID: "tags",                useStringColor: true,            },        ]    },    {        id: "shape",        label: "SHAPE",        properties: [            {                label: "Shape",                type: "dropdown",                options: { Cube: "Box", Sphere: "Sphere", Tetrahedron: "Tetrahedron", Octahedron: "Octahedron",                            Icosahedron: "Icosahedron", Dodecahedron: "Dodecahedron", Hexagon: "Hexagon",                            Triangle: "Triangle", Octagon: "Octagon", Cylinder: "Cylinder", Cone: "Cone",                            Circle: "Circle", Quad: "Quad", Torus: "Torus" },                propertyID: "shape",            },            {                label: "Inner Radius",                type: "number-draggable",                min: 0,                max: 0.25,                step: 0.01,                decimals: 2,                propertyID: "innerRadius",                showPropertyRule: { "shape": "Torus" },            },            {                label: "Color",                type: "color",                propertyID: "color",            },            {                label: "Alpha",                type: "number-draggable",                min: 0,                max: 1,                step: 0.01,                decimals: 2,                propertyID: "shapeAlpha",                propertyName: "alpha",            },            {                label: "Unlit",                type: "bool",                propertyID: "shapeUnlit",                propertyName: "unlit"            }        ]    },    {        id: "text",        label: "TEXT",        properties: [            {                label: "Text",                type: "textarea",                propertyID: "text",            },            {                label: "Text Color",                type: "color",                propertyID: "textColor",            },            {                label: "Text Alpha",                type: "number-draggable",                min: 0,                max: 1,                step: 0.01,                decimals: 2,                propertyID: "textAlpha",            },            {                label: "Background Color",                type: "color",                propertyID: "backgroundColor",            },            {                label: "Background Alpha",                type: "number-draggable",                min: 0,                max: 1,                step: 0.01,                decimals: 2,                propertyID: "backgroundAlpha",            },            {                label: "Line Height",                type: "number-draggable",                min: 0,                step: 0.001,                decimals: 4,                unit: "m",                propertyID: "lineHeight",            },            {                label: "Font",                type: "string",                propertyID: "font",            },            {                label: "Effect",                type: "dropdown",                options: {                    none: "None",                    outline: "Outline",                    "outline fill": "Outline with fill",                    shadow: "Shadow"                },                propertyID: "textEffect",            },            {                label: "Effect Color",                type: "color",                propertyID: "textEffectColor",            },            {                label: "Effect Thickness",                type: "number-draggable",                min: 0.0,                max: 0.5,                step: 0.01,                decimals: 2,                propertyID: "textEffectThickness",            },            {                label: "Alignment",                type: "dropdown",                options: {                    left: "Left",                    center: "Center",                    right: "Right"                },                propertyID: "textAlignment",                propertyName: "alignment", // actual entity property name            },            {                label: "Vertical Alignment",                type: "dropdown",                options: {                    top: "Top",                    center: "Center",                    bottom: "Bottom"                },                propertyID: "textVerticalAlignment",                propertyName: "verticalAlignment", // actual entity property name            },            {                label: "Top Margin",                type: "number-draggable",                step: 0.01,                decimals: 2,                propertyID: "topMargin",            },            {                label: "Right Margin",                type: "number-draggable",                step: 0.01,                decimals: 2,                propertyID: "rightMargin",            },            {                label: "Bottom Margin",                type: "number-draggable",                step: 0.01,                decimals: 2,                propertyID: "bottomMargin",            },            {                label: "Left Margin",                type: "number-draggable",                step: 0.01,                decimals: 2,                propertyID: "leftMargin",            },            {                label: "Unlit",                type: "bool",                propertyID: "unlit",            }        ]    },    {        id: "zone",        label: "ZONE",        properties: [            {                label: "Shape Type",                type: "dropdown",                options: { "box": "Box", "sphere": "Sphere",                           "cylinder-y": "Cylinder", "compound": "Use Compound Shape URL" },                propertyID: "zoneShapeType",                propertyName: "shapeType", // actual entity property name            },            {                label: "Compound Shape URL",                type: "string",                propertyID: "zoneCompoundShapeURL",                propertyName: "compoundShapeURL", // actual entity property name                placeholder: "URL",            },            {                label: "Flying Allowed",                type: "bool",                propertyID: "flyingAllowed",            },            {                label: "Ghosting Allowed",                type: "bool",                propertyID: "ghostingAllowed",            },            {                label: "Filter",                type: "string",                propertyID: "filterURL",                placeholder: "URL",            }        ]    },    {        id: "zone_key_light",        label: "ZONE KEY LIGHT",        properties: [            {                label: "Key Light",                type: "dropdown",                options: { inherit: "Inherit", disabled: "Off", enabled: "On" },                propertyID: "keyLightMode",                            },            {                label: "Key Light Color",                type: "color",                propertyID: "keyLight.color",                showPropertyRule: { "keyLightMode": "enabled" },            },            {                label: "Light Intensity",                type: "number-draggable",                min: -40,                max: 40,                step: 0.01,                decimals: 2,                propertyID: "keyLight.intensity",                showPropertyRule: { "keyLightMode": "enabled" },            },            {                label: "Light Horizontal Angle",                type: "number-draggable",                step: 0.1,                multiplier: DEGREES_TO_RADIANS,                decimals: 2,                unit: "deg",                propertyID: "keyLight.direction.y",                showPropertyRule: { "keyLightMode": "enabled" },            },            {                label: "Light Vertical Angle",                type: "number-draggable",                step: 0.1,                multiplier: DEGREES_TO_RADIANS,                decimals: 2,                unit: "deg",                propertyID: "keyLight.direction.x",                showPropertyRule: { "keyLightMode": "enabled" },            },            {                label: "Cast Shadows",                type: "bool",                propertyID: "keyLight.castShadows",                showPropertyRule: { "keyLightMode": "enabled" },            },            {                label: "Shadow Bias",                type: "number-draggable",                min: 0,                max: 1,                step: 0.01,                decimals: 2,                propertyID: "keyLight.shadowBias",                showPropertyRule: { "keyLightMode": "enabled" },            },            {                label: "Shadow Max Distance",                type: "number-draggable",                min: 0,                max: 250,                step: 0.1,                decimals: 2,                propertyID: "keyLight.shadowMaxDistance",                showPropertyRule: { "keyLightMode": "enabled" },            }        ]    },        {        id: "zone_skybox",        label: "ZONE SKYBOX",        properties: [            {                label: "Skybox",                type: "dropdown",                options: { inherit: "Inherit", disabled: "Off", enabled: "On" },                propertyID: "skyboxMode",            },            {                label: "Skybox Color",                type: "color",                propertyID: "skybox.color",                showPropertyRule: { "skyboxMode": "enabled" },            },            {                label: "Skybox Source",                type: "string",                propertyID: "skybox.url",                showPropertyRule: { "skyboxMode": "enabled" },                placeholder: "URL",            }        ]    },    {        id: "zone_ambient_light",        label: "ZONE AMBIENT LIGHT",        properties: [            {                label: "Ambient Light",                type: "dropdown",                options: { inherit: "Inherit", disabled: "Off", enabled: "On" },                propertyID: "ambientLightMode",            },            {                label: "Ambient Color",                type: "color",                propertyID: "ambientLight.ambientColor",                showPropertyRule: { "ambientLightMode": "enabled" },

Lines 1–500 of 7536.