Scene API.
Most of the routines presented here require an active scene to be set,
use get_active() set_active() to do that.
- Source:
Summary
Members
Methods
- append_object(obj, scene_nameopt)
- apply_outline_anim(obj, tau, T, N)
- apply_outline_anim_def(obj)
- can_select_objects() → {boolean}
- check_object_by_dupli_name(empty_name, dupli_name, data_idopt) → {boolean}
- check_object_by_dupli_name_list(name_list, data_idopt) → {boolean}
- check_object_by_name(name, data_idopt) → {boolean}
- clear_outline_anim(obj)
- get_active() → {string}
- get_active_camera() → {Object3D}
- get_all_objects(typeopt, data_idopt) → {Array.<Object3D>}
- get_bloom_params() → {module:scenes~BloomParams}
- get_cam_water_depth() → {number}
- get_color_correction_params() → {module:scenes~ColorCorrectionParams}
- get_custom_prop() → {*}
- get_dof_params() → {module:scenes~DOFParams}
- get_environment_colors() → {Array}
- get_first_character() → {Object3D}
- get_fog_color_density(dest) → {Vec4}
- get_fog_params() → {FogParams}
- get_glow_material_params() → {GlowMaterialParams}
- get_god_rays_params() → {GodRaysParams}
- get_mb_params() → {MotionBlurParams}
- get_meta_tags() → {module:scenes~SceneMetaTags}
- get_object_by_dupli_name(empty_name, dupli_name, data_idopt) → {Object3D}
- get_object_by_dupli_name_list(name_list, data_idopt) → {Object3D}
- get_object_by_name(name, data_idopt) → {Object3D}
- get_object_children(obj) → {Array.<Object3D>}
- get_object_data_id(obj) → {number}
- get_object_name(obj) → {string}
- get_object_name_hierarchy(obj) → (nullable) {Array}
- get_object_type(obj) → {string}
- get_outline_color(destnullable) → {RGB}
- get_outline_intensity(obj) → {number}
- get_scenes() → {Array.<string>}
- get_shadow_params() → {ShadowParams}
- get_shore_dist(trans, v_dist_multopt) → {number}
- get_sky_params() → {module:scenes~SkyParams}
- get_ssao_params() → {module:scenes~SSAOParams}
- get_type_mesh_object(obj) → {string}
- get_water_mat_params(water_params)
- get_water_surface_level(pos_x, pos_y) → {number}
- get_wind_params() → {module:scenes~WindParams}
- get_world_by_name(name, data_idopt) → {Object3D}
- hide_object(obj, ignore_childrenopt)
- is_hidden(obj) → {boolean}
- is_visible(obj) → {boolean}
- marker_frame(name) → {number}
- outlining_is_enabled(obj) → {boolean}
- pick_center() → (nullable) {Object3D}
- pick_object(x, y) → (nullable) {Object3D}
- remove_object(obj)
- set_active(scene_name)
- set_bloom_params(bloom_params)
- set_color_correction_params(color_corr_params)
- set_dof_params(dof_params)
- set_environment_colors(opt_environment_energyopt, opt_horizon_coloropt, opt_zenith_coloropt)
- set_fog_color_density(val)
- set_fog_params(fog_params)
- set_glow_material_params(glow_material_params)
- set_god_rays_params(god_rays_params)
- set_hmd_params(hmd_params)
- set_mb_params(mb_params)
- set_outline_color(color)
- set_outline_intensity(obj, value)
- set_shadow_params(shadow_params)
- set_sky_params(sky_params)
- set_ssao_params(ssao_params)
- set_water_params(water_params)
- set_wind_params(wind_params)
- show_object(obj, ignore_childrenopt)
- update_scene_materials_params()
Type Definitions
Detailed Description
Members
DATA_ID_ALL
All possible data IDs.
- Source:
Methods
append_object(obj, scene_nameopt)
Append copied object to the scene.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
obj |
Object3D | Object 3D | |
scene_name |
string |
<optional> |
Name of the scene |
- Source:
Example
var m_scs = require("scenes");
var m_obj = require("objects");
var src_obj = m_scs.get_object_by_name("Plane");
var deep_copy = m_obj.copy(src_obj, "deep_copy", true);
m_scs.append_object(deep_copy);
apply_outline_anim(obj, tau, T, N)
Apply outlining animation to the object
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D |
tau |
number | Outlining duration |
T |
number | Period of outlining |
N |
number | Number of relapses (0 - infinity) |
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
m_scenes.apply_outline_anim(cube, 10, 5, 0);
apply_outline_anim_def(obj)
Apply outlining animation to the object and use the object's default settings
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D |
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
m_scenes.apply_outline_anim_def(cube);
can_select_objects() → {boolean}
Check if objects can be selected.
Returns:
True if objects can be selected.
- Type
- boolean
- Source:
Example
var m_scenes = require("scenes");
var objects_selectable = m_scenes.can_select_objects();
check_object_by_dupli_name(empty_name, dupli_name, data_idopt) → {boolean}
Check if duplicated object is present on scene by empty name and dupli name.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
empty_name |
string | Name of the EMPTY object used to duplicate the object | ||
dupli_name |
string | Name of the duplicated object | ||
data_id |
number |
<optional> |
0 | ID of loaded data |
Returns:
Check result
- Type
- boolean
- Source:
check_object_by_dupli_name_list(name_list, data_idopt) → {boolean}
Check if duplicated object is present on scene by empty name and dupli name list.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name_list |
Array.<string> | List of the EMPTY and DUPLI object names: [empty_name,empty_name,...,dupli_name] | ||
data_id |
number |
<optional> |
0 | ID of loaded data |
Returns:
Check result
- Type
- boolean
- Source:
check_object_by_name(name, data_idopt) → {boolean}
Check if object with given name is present on scene.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string | Object name | ||
data_id |
number |
<optional> |
0 | ID of loaded data |
Returns:
Check result
- Type
- boolean
- Source:
clear_outline_anim(obj)
Stop outlining animation for the object.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D |
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
m_scenes.clear_outline_anim(cube);
get_active() → {string}
Get the current active scene
Returns:
Active scene name
- Type
- string
- Source:
Example
var m_scenes = require("scenes");
var current_scene = m_scenes.get_active();
get_active_camera() → {Object3D}
Return the active camera object from the active scene.
Returns:
Camera object.
- Type
- Object3D
- Source:
Example
var m_scenes = require("scenes");
var camera = m_scenes.get_active_camera();
get_all_objects(typeopt, data_idopt) → {Array.<Object3D>}
Get all objects from the active scene.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
string |
<optional> |
"ALL" | Object type. |
data_id |
number |
<optional> |
DATA_ID_ALL | Objects data id |
Returns:
Array with objects.
- Type
- Array.<Object3D>
- Source:
Example
var m_scenes = require("scenes");
// get objects of all types
var scene_object_list = m_scenes.get_all_objects();
// get all MESH objects
var scene_object_list = m_scenes.get_all_objects("MESH");
// get all SPEAKER objects from the first dynamically loaded scene
var scene_object_list = m_scenes.get_all_objects("SPEAKER", 1);
get_bloom_params() → {BloomParams}
Get bloom parameters
Returns:
bloom parameters
- Type
- BloomParams
- Source:
Example
var m_scenes = require("scenes");
var bloom_parameters = m_scenes.get_bloom_params();
get_cam_water_depth() → {number}
Return the camera water depth or null if there is no water.
Returns:
Depth
- Type
- number
- Source:
Example
var m_scenes = require("scenes");
var water_depth = m_scenes.get_cam_water_depth();
get_color_correction_params() → {ColorCorrectionParams}
Get color correction params
Returns:
Color correction params
- Source:
Example
var m_scenes = require("scenes");
var color_parameters = m_scenes.get_color_correction_params();
get_custom_prop() → {*}
Get the Blender-assigned custom property from the active scene.
Returns:
Scene custom property
- Type
- *
- Source:
get_dof_params() → {DOFParams}
Get depth-of-field (DOF) params.
Returns:
The object containing DOF parameters.
- Type
- DOFParams
- Source:
Example
var m_scenes = require("scenes");
var dof_params = m_scenes.get_dof_params();
get_environment_colors() → {Array}
Get horizon and zenith colors of the environment.
Returns:
Environment colors
- Type
- Array
- Source:
Example
var m_scenes = require("scenes");
var environment_colors = m_scenes.get_environment_colors();
get_first_character() → {Object3D}
Find the first character on the active scene.
Returns:
Character object.
- Type
- Object3D
- Source:
Example
var m_scenes = require("scenes");
var character = m_scenes.get_first_character();
get_fog_color_density(dest) → {Vec4}
get_fog_params() → {FogParams}
Get fog params
Returns:
Fog params
- Type
- FogParams
- Source:
Example
var m_scenes = require("scenes");
var fog_params = m_scenes.get_fog_params();
get_glow_material_params() → {GlowMaterialParams}
Get glow material parameters
Returns:
glow material parameters
- Type
- GlowMaterialParams
- Source:
Example
var m_scenes = require("scenes");
var glow_params = m_scenes.get_glow_material_params();
get_god_rays_params() → {GodRaysParams}
Get god rays parameters
Returns:
god rays parameters
- Type
- GodRaysParams
- Source:
Example
var m_scenes = require("scenes");
var god_ray_params = m_scenes.get_god_rays_params();
get_mb_params() → {MotionBlurParams}
Get motion blur params.
Returns:
Motion blur params
- Type
- MotionBlurParams
- Source:
Example
var m_scenes = require("scenes");
var motion_blur_params = m_scenes.get_mb_params();
get_meta_tags() → {SceneMetaTags}
Get the Blender-assigned meta tags from the active scene.
Returns:
Scene meta tags
- Type
- SceneMetaTags
- Source:
Example
var m_scenes = require("scenes");
var meta_tags = m_scenes.get_meta_tags();
get_object_by_dupli_name(empty_name, dupli_name, data_idopt) → {Object3D}
Get the duplicated object by empty name and dupli name.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
empty_name |
string | Name of the EMPTY object used to duplicate the object | ||
dupli_name |
string | Name of the duplicated object | ||
data_id |
number |
<optional> |
0 | ID of loaded data |
Returns:
Object 3D
- Type
- Object3D
- Source:
get_object_by_dupli_name_list(name_list, data_idopt) → {Object3D}
Get the duplicated object by empty name and dupli name list.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name_list |
Array.<string> | List of the EMPTY and DUPLI object names: [empty_name,empty_name,...,dupli_name]. Can be retrieved with the get_object_name_hierarchy() method. | ||
data_id |
number |
<optional> |
0 | ID of loaded data. |
Returns:
Object 3D.
- Type
- Object3D
- Source:
get_object_by_name(name, data_idopt) → {Object3D}
Get object by name.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string | Object name | ||
data_id |
number |
<optional> |
0 | ID of loaded data |
Returns:
Object 3D
- Type
- Object3D
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
get_object_children(obj) → {Array.<Object3D>}
Return the object's children.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D |
Returns:
Array of children objects.
- Type
- Array.<Object3D>
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
var object_children = m_scenes.get_object_children(cube);
get_object_data_id(obj) → {number}
Returns object data_id property.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D |
Returns:
data_id Data ID property
- Type
- number
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
var data_id = m_scenes.get_object_data_id(cube);
get_object_name(obj) → {string}
Get the object's name.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D |
Returns:
Object name
- Type
- string
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
var object_name = m_scenes.get_object_name(cube);
get_object_name_hierarchy(obj) → (nullable) {Array}
Get the object names hierarchy (considering dupli group parenting).
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D |
Returns:
Object names hierarchy array (from the highest parent to the object itself).
- Type
- Array
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
var name_hierarchy = m_scenes.get_object_name_hierarchy(cube);
get_object_type(obj) → {string}
Get the object's type.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D |
Returns:
Object type
- Type
- string
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
var object_type = m_scenes.get_object_type(cube);
get_outline_color(destnullable) → {RGB}
Get the color of outline outline effect for active scene.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
dest |
RGB |
<nullable> |
Destination RGB color vector |
Returns:
Destination RGB color vector
- Type
- RGB
- Source:
Example
var m_scenes = require("scenes");
var outline_color = new Float32Array(3);
m_scenes.get_outline_color(outline_color);
get_outline_intensity(obj) → {number}
Get outline intensity for the object.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D |
Returns:
Intensity value
- Type
- number
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
var outline_intensity = m_scenes.get_outline_intensity(cube);
get_scenes() → {Array.<string>}
Get all scene names.
Returns:
Array of scene names.
- Type
- Array.<string>
- Source:
Example
var m_scenes = require("scenes");
var scene_list = m_scenes.get_scenes();
get_shadow_params() → {ShadowParams}
Get shadow params.
Returns:
Shadow params
- Type
- ShadowParams
- Source:
Example
var m_scenes = require("scenes");
var shadow_params = m_scenes.get_shadow_params();
get_shore_dist(trans, v_dist_multopt) → {number}
Return the distance to the shore line.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
trans |
Vec3 | Current translation. | ||
v_dist_mult |
number |
<optional> |
1 | Vertical distance multiplier. |
Returns:
Distance.
- Type
- number
- Source:
get_sky_params() → {SkyParams}
Get sky params
Returns:
Sky params
- Type
- SkyParams
- Source:
Example
var m_scenes = require("scenes");
var sky_params = m_scenes.get_sky_params();
get_ssao_params() → {SSAOParams}
Get SSAO params
Returns:
SSAO params
- Type
- SSAOParams
- Source:
Example
var m_scenes = require("scenes");
var ssao_params = m_scenes.get_ssao_params();
get_type_mesh_object(obj) → {string}
Return render type of mesh object or null.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D. |
Returns:
Render type: "DYNAMIC" or "STATIC" or ""(for non meshes).
- Type
- string
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
var type = m_scenes.get_type_mesh_object(cube);
get_water_mat_params(water_params)
Get water material parameters.
Parameters:
Name | Type | Description |
---|---|---|
water_params |
WaterParams | Water parameters |
- Source:
get_water_surface_level(pos_x, pos_y) → {number}
Get water surface level.
Parameters:
Name | Type | Description |
---|---|---|
pos_x |
number | World x position |
pos_y |
number | World y position |
Returns:
Surface level
- Type
- number
- Source:
Example
var m_scenes = require("scenes");
var water_level = m_scenes.get_water_surface_level(10.3, 15.6);
get_wind_params() → {WindParams}
Get wind parameters
Returns:
Wind params
- Type
- WindParams
- Source:
Example
var m_scenes = require("scenes");
var wind_parameters = m_scenes.get_wind_params();
get_world_by_name(name, data_idopt) → {Object3D}
Get world by name.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string | World name | ||
data_id |
number |
<optional> |
0 | ID of loaded data |
Returns:
Object 3D
- Type
- Object3D
- Source:
Example
m_scenes = require("scenes");
var world_obj = m_scenes.get_world_by_name("World");
hide_object(obj, ignore_childrenopt)
Hide object and his children if it's necessary.
Supported only for dynamic meshes/empties and lamps.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
obj |
Object3D | Object 3D | ||
ignore_children |
boolean |
<optional> |
false | Don't hide child objects. |
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
m_scenes.hide_object(cube);
is_hidden(obj) → {boolean}
Check if object is hidden.
Supported only for dynamic meshes/empties and lamps.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D |
Returns:
Check result
- Type
- boolean
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
var object_is_hidden = m_scenes.is_hidden(cube);
is_visible(obj) → {boolean}
Check if object is visible.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D |
Returns:
Check result
- Type
- boolean
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
var object_is_visible = m_scenes.is_visible(cube);
marker_frame(name) → {number}
Get timeline marker frame by name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Timeline marker name |
Returns:
Timeline marker frame
- Type
- number
- Source:
outlining_is_enabled(obj) → {boolean}
Check if the outlining is enabled or not for the object.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D |
Returns:
Checking result.
- Type
- boolean
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
var outlining_is_enabled = m_scenes.outlining_is_enabled(cube);
pick_center() → (nullable) {Object3D}
Render the color scene and return an object in the viewport center.
Returns:
The object in the viewport center.
- Type
- Object3D
- Source:
pick_object(x, y) → (nullable) {Object3D}
For given mouse coords, render the color scene and return an object.
Parameters:
Name | Type | Description |
---|---|---|
x |
number | X Canvas coordinate. |
y |
number | Y Canvas coordinate. |
Returns:
The object under the given coordinates or null.
- Type
- Object3D
- Source:
Example
var m_cont = require("container");
var m_scenes = require("scenes");
var canvas_cont = m_cont.get_container();
canvas_cont.addEventListener("mousedown", down_cb);
var down_cb = function(event) {
var obj = m_scenes.pick_object(event.offsetX, event.offsetY);
}
remove_object(obj)
Remove dynamic object from all scenes.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D |
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
m_scenes.remove_object(cube);
set_active(scene_name)
Set the active scene
Parameters:
Name | Type | Description |
---|---|---|
scene_name |
string | Name of the scene |
- Source:
Example
var m_scenes = require("scenes");
m_scenes.set_active("Scene");
set_bloom_params(bloom_params)
Set bloom parameters
Parameters:
Name | Type | Description |
---|---|---|
bloom_params |
BloomParams | Bloom parameters |
- Source:
Example
var m_scenes = require("scenes");
m_scenes.set_bloom_params({ key: 1, edge_lum: 0.5, blur: 4 });
set_color_correction_params(color_corr_params)
Set color correction params.
Parameters:
Name | Type | Description |
---|---|---|
color_corr_params |
ColorCorrectionParams | Color correction params. |
- Source:
Example
var m_scenes = require("scenes");
m_scenes.set_color_correction_params({ brightness: 0.2,
contrast: 0.4,
exposure: 0.9,
saturation: 0.5 });
set_dof_params(dof_params)
Set depth-of-field (DOF) params
Parameters:
Name | Type | Description |
---|---|---|
dof_params |
DOFParams | The object containing DOF parameters. |
- Source:
Example
var m_scenes = require("scenes");
// adjusting the front/rear distances
m_scenes.set_dof_params({ dof_front_start: 0,
dof_front_end: 2,
dof_rear_start: 0,
dof_rear_end: 5 });
// disabling the DOF effect
m_scenes.set_dof_params({ dof_on: false });
set_environment_colors(opt_environment_energyopt, opt_horizon_coloropt, opt_zenith_coloropt)
Set horizon and/or zenith color(s) of the environment.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
opt_environment_energy |
number |
<optional> |
Environment Energy |
opt_horizon_color |
RGB |
<optional> |
Horizon color |
opt_zenith_color |
RGB |
<optional> |
Zenith color |
- Source:
Example
var m_rgb = require("rgb");
var m_scenes = require("scenes");
var horizon_color = m_rgb.from_values(0.5, 0.1, 0.1);
var zenith_color = m_rgb.from_values(0.1, 0.1, 0.8);
m_scenes.set_environment_colors(0.8, horizon_color, zenith_color);
set_fog_color_density(val)
Set fog color and density
Parameters:
Name | Type | Description |
---|---|---|
val |
Vec4 | Color-density vector [C,C,C,D] |
- Source:
Example
var m_scenes = require("scenes");
m_scenes.set_fog_color_density([0.5, 0.5, 0.7, 0.05]);
set_fog_params(fog_params)
Set fog params
Parameters:
Name | Type | Description |
---|---|---|
fog_params |
FogParams | Fog params |
- Source:
Example
var m_scenes = require("scenes");
m_scenes.set_fog_params({ fog_intensity: 1,
fog_depth: 25,
fog_start: 5,
fog_height: 0 });
set_glow_material_params(glow_material_params)
Set glow material parameters
Parameters:
Name | Type | Description |
---|---|---|
glow_material_params |
GlowMaterialParams | Glow material parameters |
- Source:
set_god_rays_params(god_rays_params)
Set god rays parameters
Parameters:
Name | Type | Description |
---|---|---|
god_rays_params |
GodRaysParams | God rays parameters |
- Source:
Example
var m_scenes = require("scenes");
m_scenes.set_god_rays_params({ god_rays_max_ray_length: 1,
god_rays_intensity: 0.7,
god_rays_steps: 10 });
set_hmd_params(hmd_params)
Set head-mounted display params.
Parameters:
Name | Type | Description |
---|---|---|
hmd_params |
HMDParams | Head-mounted display params. |
- Source:
set_mb_params(mb_params)
Set motion blur params.
Parameters:
Name | Type | Description |
---|---|---|
mb_params |
MotionBlurParams | Motion blur params |
- Source:
Example
var m_scenes = require("scenes");
m_scenes.set_mb_params({ mb_factor: 0.1,
mb_decay_threshold: 0.01 });
set_outline_color(color)
Set the color of outline outline effect for active scene.
Parameters:
Name | Type | Description |
---|---|---|
color |
RGB | RGB color vector |
- Source:
Example
var m_scenes = require("scenes");
m_scenes.set_outline_color([0.8, 0.2, 0.8]);
set_outline_intensity(obj, value)
Set outline intensity for the object.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object3D | Object 3D |
value |
number | Intensity value |
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
m_scenes.set_outline_intensity(cube, 0.4);
set_shadow_params(shadow_params)
Set shadow params
Parameters:
Name | Type | Description |
---|---|---|
shadow_params |
ShadowParams | Shadow params |
- Source:
Example
var m_scenes = require("scenes");
m_scenes.set_shadow_params({ blend_between_cascades: true,
blur_radii: null,
csm_borders: null,
csm_first_cascade_border: 10,
csm_last_cascade_border: 100,
csm_num: 1,
csm_resolution: 2048,
enable_csm: true,
fade_last_cascade: true,
first_cascade_blur_radius: 3,
last_cascade_blur_radius: 1.5,
self_shadow_normal_offset: 0.01,
self_shadow_polygon_offset: 1 });
set_sky_params(sky_params)
Set sky params
Parameters:
Name | Type | Description |
---|---|---|
sky_params |
SkyParams | Sky params |
- Source:
Example
var m_scenes = require("scenes");
m_scenes.set_sky_params({ rayleigh_brightness: 3.3,
mie_brightness: 0.1,
spot_brightness: 20,
scatter_strength: 0.2,
rayleigh_strength: 0.2,
mie_strength: 0.006,
rayleigh_collection_power: 0.35,
mie_collection_power: 0.5,
mie_distribution: 0.4,
color: [0.3, 0.9, 0.3] });
set_ssao_params(ssao_params)
Set SSAO params
Parameters:
Name | Type | Description |
---|---|---|
ssao_params |
SSAOParams | SSAO params |
- Source:
Example
var m_scenes = require("scenes");
m_scenes.set_ssao_params({ quality: 16,
radius_increase: 3,
use_hemisphere: true,
use_blur_depth: false,
blur_discard_value: 1,
influence: 0.7,
dist_factor: 0,
ssao_white: false,
ssao_only: false });
set_water_params(water_params)
Set water params
Parameters:
Name | Type | Description |
---|---|---|
water_params |
WaterParams | Water parameters |
- Source:
set_wind_params(wind_params)
Set wind parameters
Parameters:
Name | Type | Description |
---|---|---|
wind_params |
WindParams | Wind parameters |
- Source:
Example
var m_scenes = require("scenes");
m_scenes.set_wind_params({ wind_dir: 90,
wind_strength: 3 });
show_object(obj, ignore_childrenopt)
Show object and his children if it's necessary.
Supported only for dynamic meshes/empties and lamps.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
obj |
Object3D | Object 3D | ||
ignore_children |
boolean |
<optional> |
false | Don't show child objects. |
- Source:
Example
var m_scenes = require("scenes");
var cube = m_scenes.get_object_by_name("Cube");
m_scenes.show_object(cube);
update_scene_materials_params()
Update scene materials parameters.
- Source:
Example
var m_scenes = require("scenes");
m_scenes.update_scene_materials_params();
Type Definitions
BloomParams
Bloom params.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
key |
number | Strength of bloom effect |
edge_lum |
number | Luminance threshold above which bloom is visible. |
blur |
number | The amount of blur applied to bloom effect. |
average_luminance |
number | The average luminance of the frame. Has influence only when the adaptive bloom is disabled. |
- Source:
ColorCorrectionParams
Color correction params.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
brightness |
number |
<optional> |
Brightness |
contrast |
number |
<optional> |
Contrast |
exposure |
number |
<optional> |
Exposure |
saturation |
number |
<optional> |
Saturation |
- Source:
DOFParams
Depth of Field parameters. Readonly properties like the "dof_bokeh" and the
"dof_object" can be only set beforehand in Blender.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
dof_on |
boolean | Use DOF. |
dof_distance |
number | The distance to the focal point. Readonly if the "dof_object" property is set, which has a higher priority. |
dof_front_start |
number | The distance in front of the focal point where the DOF effect starts. Disabled (has zero value and readonly status) if the "dof_bokeh" property is False. |
dof_front_end |
number | The distance in front of the focal point where the DOF effect reaches its maximum power. |
dof_rear_start |
number | The distance beyond the focal point where the DOF effect starts. Disabled (has zero value and readonly status) if the "dof_bokeh" property is False. |
dof_rear_end |
number | The distance beyond the focal point where the DOF effect reaches its maximum power. |
dof_power |
number | The DOF intensity. |
dof_bokeh |
boolean | Use bokeh DOF (readonly). |
dof_bokeh_intensity |
number | The brightness of the bokeh DOF effect. |
dof_object |
Object3D | The object which center defines the focal point. Controls the "dof_distance" property if set (readonly). |
- Source:
HMDParams
Head-mounted display params.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
enable_hmd_stereo |
boolean | Enable hmd stereo |
distortion_coefs |
Array | Distortion coefficient list |
chromatic_aberration_coefs |
Array | Chromatic aberration coefficient list |
base_line_factor |
number | Tray to lens-center distance divided by screen height |
inter_lens_factor |
number | Inter-lens distance divided by screen width |
- Source:
SceneMetaTags
Scene meta tags.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
title |
string | The title meta tag. |
description |
string | The description meta tag. |
- Source:
SkyParams
Procedural Sky Parameters
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
procedural_skydome |
boolean |
<optional> |
Procedural sky is used (readonly). |
use_as_environment_lighting |
boolean |
<optional> |
Procedural sky is used for calculating environment lighting (readonly). |
rayleigh_brightness |
number |
<optional> |
Brightness of Rayleigh scattering. Available only if "procedural_skydome" is True. |
mie_brightness |
number |
<optional> |
Brightness of Mie scattering. Available only if "procedural_skydome" is True. |
spot_brightness |
number |
<optional> |
Brightness of the sun spot. Available only if "procedural_skydome" is True. |
scatter_strength |
number |
<optional> |
The strength of the light scattering. Available only if "procedural_skydome" is True. |
rayleigh_strength |
number |
<optional> |
The strength of the Rayleigh scattering. Available only if "procedural_skydome" is True. |
mie_strength |
number |
<optional> |
The strength of the Mie scattering. Available only if "procedural_skydome" is True. |
rayleigh_collection_power |
number |
<optional> |
Rayleigh collection power. Available only if "procedural_skydome" is True. |
mie_collection_power |
number |
<optional> |
Mie collection power. Available only if "procedural_skydome" is True. |
mie_distribution |
number |
<optional> |
Mie distribution. Available only if "procedural_skydome" is True. |
color |
RGB |
<optional> |
The base color of the procedural sky. Available only if "procedural_skydome" is True. |
- Source:
SSAOParams
SSAO Parameters
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
quality |
number |
<optional> |
The number of samples used for calculating SSAO. Must be 8, 16, 24 or 32. |
radius_increase |
number |
<optional> |
The spherical sampling radius multiply factor when transferring from the internal sampling ring to the external one. |
use_hemisphere |
boolean |
<optional> |
Use hemisphere to calculate SSAO. |
use_blur_depth |
boolean |
<optional> |
Apply edge-preserving blur to SSAO. |
blur_discard_value |
number |
<optional> |
Influence of depth difference between samples on blur weight. |
influence |
number |
<optional> |
How much AO affects the final rendering. |
dist_factor |
number |
<optional> |
How much AO decreases with distance. |
ssao_white |
boolean |
<optional> |
Turn SSAO white, basically disabling it. |
ssao_only |
boolean |
<optional> |
Only SSAO and not the regular render will be visible. |
- Source:
WindParams
Wind Parameters
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
wind_dir |
number |
<optional> |
The direction of the wind. |
wind_strength |
number |
<optional> |
The strength of the wind. |
- Source: