Module: objects

Objects API.

Additional topics in the User Manual: Object Transform API, Get Object API, Object Selection, Copying Objects (Instancing)

Summary

Methods

Type Definitions

Detailed Description

Methods

copy(obj, name, deep_copyopt) → {Object3D}

Copy MESH object.
Parameters:
Name Type Attributes Default Description
obj Object3D Object 3D
name string New unique object name
deep_copy boolean <optional>
false Copy WebGL buffers
Returns:
New object.
Type
Object3D
Source:

create_line(name)

Create line object
Parameters:
Name Type Description
name string Line object name
Source:

get_custom_prop(obj) → {*}

Get the Blender-assigned custom property field from the object.
Parameters:
Name Type Description
obj Object3D Object 3D
Returns:
Object custom property field
Type
*
Source:

get_dg_parent(obj) → (nullable) {Object3D}

Get DupliGroup parent object.
Parameters:
Name Type Description
obj Object3D Child object
Returns:
Parent object
Type
Object3D
Source:

get_meta_tags(obj) → {ObjectMetaTags}

Get the Blender-assigned meta tags from the object.
Parameters:
Name Type Description
obj Object3D Object 3D
Returns:
Object meta tags
Type
ObjectMetaTags
Source:

get_nodemat_rgb(obj, name_list, destopt) → {RGB}

Get color of the RGB node in the object's material.
Parameters:
Name Type Attributes Description
obj Object3D Object 3D
name_list Array.<string> List consisting of the material name, the names of nested node groups (if any) and the name of the RGB node itself
dest Vec3 <optional>
Destination color
Returns:
Destination color
Type
RGB
Deprecated:
Source:

get_nodemat_value(obj, name_list) → {number}

Get value of the Value node in the object's material.
Parameters:
Name Type Description
obj Object3D Object 3D
name_list Array.<string> List consisting of the material name, the names of nested node groups (if any) and the name of the Value node itself. Should have at least 2 elements ["Mat","Node"]
Returns:
Value.
Type
number
Deprecated:
Source:

get_outlining_objects() → {Array.<Object3D>}

Get all scene outlining objects.
Returns:
Array with outlining objects.
Type
Array.<Object3D>
Source:

get_parent(obj) → (nullable) {Object3D}

Get parent object.
Parameters:
Name Type Description
obj Object3D Child object
Returns:
Parent object
Type
Object3D
Source:

get_selectable_objects() → {Array.<Object3D>}

Get all scene selectable objects.
Returns:
Array with selectable objects.
Type
Array.<Object3D>
Source:

get_wind_bending_params(obj) → {WindBendingParams}

Get object's wind bending parameters. Object must be dynamic.
Parameters:
Name Type Description
obj Object3D Object 3D
Returns:
Wind Bending parameters
Type
WindBendingParams
Source:

is_armature(obj) → {boolean}

Check if the object is an ARMATURE.
Parameters:
Name Type Description
obj Object3D Object 3D
Returns:
Checking result.
Type
boolean
Source:

is_camera(obj) → {boolean}

Check if the object is a CAMERA.
Parameters:
Name Type Description
obj Object3D Object 3D
Returns:
Checking result.
Type
boolean
Source:

is_dynamic(obj) → {boolean}

Check if object is dynamic.
Parameters:
Name Type Description
obj Object3D Object 3D
Returns:
Checking result.
Type
boolean
Source:

is_empty(obj) → {boolean}

Check if the object is an EMPTY.
Parameters:
Name Type Description
obj Object3D Object 3D
Returns:
Checking result.
Type
boolean
Source:

is_lamp(obj) → {boolean}

Check if the object is a LAMP.
Parameters:
Name Type Description
obj Object3D Object 3D
Returns:
Checking result.
Type
boolean
Source:

is_line(obj) → {boolean}

Check if the object is a LINE.
Parameters:
Name Type Description
obj Object3D Object 3D
Returns:
Checking result.
Type
boolean
Source:

is_mesh(obj) → {boolean}

Check if the object is a MESH.
Parameters:
Name Type Description
obj Object3D Object 3D
Returns:
Checking result.
Type
boolean
Source:

is_speaker(obj) → {boolean}

Check if the object is a SPEAKER.
Parameters:
Name Type Description
obj Object3D Object 3D
Returns:
Checking result.
Type
boolean
Source:

is_world(obj) → {boolean}

Check if the object is a WORLD.
Parameters:
Name Type Description
obj Object3D Object 3D
Returns:
Checking result.
Type
boolean
Source:

set_nodemat_rgb(obj, name_list, r, g, b)

Set color of the RGB node in the object's material.
Parameters:
Name Type Description
obj Object3D Object 3D
name_list Array.<string> List consisting of the material name, the names of nested node groups (if any) and the name of the RGB node itself
r number The value to set the red channel of the RGB node to [0..1]
g number The value to set the green channel of the RGB node to [0..1]
b number The value to set the blue channel of the RGB node to [0..1]
Deprecated:
Source:

set_nodemat_value(obj, name_list, value)

Set value of the Value node in the object's material.
Parameters:
Name Type Description
obj Object3D Object 3D
name_list Array.<string> List consisting of the material name, the names of nested node groups (if any) and the name of the Value node itself. Should have at least 2 elements ["Mat","Node"]
value number The value to set the Value node to
Deprecated:
Source:

set_wind_bending_params(obj, wb_params)

Set object's wind bending parameters. Object must be dynamic.
Parameters:
Name Type Description
obj Object3D Object 3D
wb_params WindBendingParams Wind Bending parameters
Source:
Example
var m_obj = require("objects");
var wb_params =
{
    angle: 3,
    main_frequency: 0.25,
    detail_frequency: 1,
    detail_amplitude: 0.1,
    branch_amplitude: 0.3
};
m_obj.set_wind_bending_params(obj, wb_params);

update_boundings(obj)

Update object's boundings (box, cone, cylinder, ellipsoid, sphere, capsule).
Parameters:
Name Type Description
obj Object3D Object 3D
Source:

Type Definitions

ObjectMetaTags

Type:
  • Object
Properties:
Name Type Description
title string The title meta tag.
description string The description meta tag.
category string The category meta tag.
Source:

WindBendingParams

Wind bending params.
Type:
  • Object
Properties:
Name Type Description
angle number Angle of main wind bending
main_frequency number Frequency of main wind bending
detail_frequency number Frequency of detail wind bending
detail_amplitude number Amplitude of detail wind bending
branch_amplitude number Amplitude of branches wind bending
Source: