Objects

The puzzles from this category perform various operations with objects.

Visual programming blocks to work with 3D objects

Contents

Puzzles Reference

show

Makes a specified object, that was initially or previously hidden, visible. Also works for a list of objects, a group (or a list of groups) or with the all objects puzzle. If there is no such object(s) present in the scene, or an object is already visible, does nothing.

Show 3D object visual programming block

hide

Makes a specified object invisible. Also works for a list of objects, a group (or a list of groups) or with the all objects puzzle. If there is no such object(s) present in the scene, or an object is already invisible, does nothing.

Hide 3D object visual programming block

is visible

Checks if an object (or any of objects in a list) is currently visible. If it so, returns the logical value true, otherwise returns false. If there is no such object(s) present in the scene, returns false.

Visual programming block to check 3D object visibility

clone object

Makes an object copy, generates a unique name for the new object and immediately adds it to the scene. Outputs the new object name. Does not work with lists, groups or the all objects puzzle.

Clone 3D object with visual programming

This puzzles supports additional options which can be activated via the gear icon:

Advanced clone object params
also clone materials
By default the "clone object" puzzle does not perform material cloning, hence the same material will be assigned to the cloned object. Enable also clone materials if you wish to clone the material (or materials) as well.
preserve object groups
By default the "clone object" puzzles resets object groups for the cloned object. Enable preserve object groups to transfer groups from the original object.

For usage example, check out the Clone Object demo (source files available in the Asset Store).

create object

Creates and adds a new object to the scene. This puzzles creates objects without the need in a 3D editor, and as such is useful for learning visual programming as well as designing primitive visuals by users with no or minimal 3D modelling skills. By using this this puzzle in combination with make object from you can create rather complex geometry.

create object puzzle

For geometry objects, such as boxes or teapots, this puzzle also creates white-colored dielectric node-based PBR material (with roughness value set to 1 and metalness set to 0). Use the set color and set value puzzles to tweak that material.

For plane with texture objects, this puzzle assigns a dummy checker texture to the model. Use the replace texture puzzle to change this texture.

The plane with html option is used to create planes which render HTML-based resources, such as websites, custom UIs, or YouTube videos.

create object puzzle creating plane with html

Internally this feature uses a 3D-transformed <iframe> element which has the width (in pixels) specified in the res input.

For usage example, check out the Htmlmixer demo (source files available in the Asset Store).

remove object

Removes a specified object from the scene. Also works for a list of objects, a group (or a list of groups) or with the all objects puzzle. If there is no such object(s) present in the scene, does nothing.

Remove object visual scripting block

set transform

Moves, rotates or scales an object according to specified transform data. The offset checkbox enables moving/rotating/scaling an object relatively to the original position/rotation/scale. Any of the axis inputs can be left blank. Also works for a list of objects, a group (or a list of groups) or with the all objects puzzle.

Set 3D transformation with visual coding

Sometimes you need to input a vector (which consists of the given X, Y, Z coordinates). In this case, you can modify the puzzle by clicking on the gear icon and setting on checkbox use vector. The world space checkbox enables transformations in world space (does euler rotation in XYZ order), otherwise does transformations in object's space.

get transform

Retrieves the position, rotation or scale data of an object. To retrieve transformations in world space click on the gear icon and set on checkbox "world space" (retrieve euler rotation in XYZ order). Does not work with lists, groups or the all objects puzzle.

Visual programming block to get 3D object transform

change local transform

Moves, rotates or scales an object according to specified transform data in its local space. Any of the axis inputs can be left blank. Also works for a list of objects, a group (or a list of groups) or with the all objects puzzle. Sometimes you need to input a vector (which consists of the given X, Y, Z coordinates). In this case, you can modify the puzzle by clicking on the gear icon and setting on checkbox use vector.

Visual programming block to change object local transform

snap to object

Moves an object to the position of another object by copying its transform data. Also copies rotation and scale. Does not work with lists, groups or the all objects puzzle.

Snap to object visual programming block

parent

Creates a parent relation between objects, so that the first object follows position/rotation/scale of the second one. Does not work with lists, groups or the all objects puzzle.

Create object parent with visual scripting

Specify <none> as the second value to unparent the object.

Remove object parent with visual scripting

set object direction

Set an object's direction to the point/vector with X, Y, Z coordinates. The point checkbox specifies whether the X, Y, Z coordinates belong to some point in 3D space or represent a direction vector. The lock up checkbox locks the up-down axis of the object so it remains perpendicular to the horizontal surface.

Set object direction visual logic block

Sometimes you need to input a vector (which consists of the given X, Y, Z coordinates). In this case, you can modify the puzzle by clicking on the gear icon and setting on checkbox use vector.

Set object direction with vector

For example, to make some object look at the camera, use the following puzzles:

Set object direction example

get object direction

Returns an object's direction vector or numeric X, Y, Z vector components.

Get object direction visual logic block

get objects from

This universal puzzle allows you to:

get objects from puzzle

By using the dropdown you can filter off objects of a kind:

For example, you can use the following puzzles to direct all mesh objects on the scene to look at the camera:

set object direction puzzle which has get objects from and get transform puzzles connected as inputs

The enable name filter checker in the gear popup activates the name filter input:

get objects from puzzle with name filter

Name filter works in a case-sensitive manner, e.g. "Cube", "cube", "CUBE" will match different objects.

The return unique object ids checker in the gear popup can be used to retrieve unique object IDs instead of names:

get objects from puzzle returning object ids

This option is very important in the case when having just the name is not sufficient – this is when objects are appended dynamically from another glTF file and happen to have same names. Another use-case is when you copy a parent object, which won't stop all the children from keeping their original names.

You can use the IDs obtained by this puzzle (which look like this: 5c464bf0-043a-40ee-b864-5c026436d7de) to pass them into other object puzzles.

Say you just loaded a scene named "NewCarScene" dynamically, which happen to contain a "Car" model. However, say there is another "Car" model already present in the main scene. To change the material on the newly added car, you need to use the following setup:

assign material puzzle which has get objects from puzzle connected as input

If you simply pass "Car" to the "assign material" puzzle, it won't work, because "FancyMaterial" will be incorrectly assigned on the first model found, which may be not what you wanted.

The "get objects from" puzzle can also be used to transform the object name to its ID (or IDs in case there are multiple objects sharing the same object name):

get objects from puzzles used to convert from object name to IDs

Other way around, in order to obtain the object name by the corresponding object ID you can do the following:

get objects from puzzles used to convert from object ID to name

set morph factor

Sets an object's morph target factor. Also works for a list of objects, a group (or a list of groups) or with the all objects puzzle.

Visual programming block to set morph factor

You can set a morph target by passing the name as a text. In this case, you need to modify the puzzle by clicking on the gear icon and setting on the checkbox flexible target input:

Advanced block to set morph factor

Example:

Controlling object morphing with visual programming

See the source files of the Parametric Models demo and also this video tutorial explaining the basics of using morph target puzzles.

get morph factor

Returns an object's morph target factor (aka value or weight). Does not work with lists, groups or the all objects puzzle.

Visual programming block to get morph factor

Example:

Getting object morphing with visual programming

You can set a morph target by passing the name as a text. In this case, you need to modify the puzzle by clicking on the gear icon and setting on the checkbox flexible target input:

Visual programming block to get morph factor

make object from

Create a new object by applying boolean (also called CSG or constructive solid geometry) operation on two input objects. If the clean checkbox is not set, the input objects are not affected and should be hidden/removed explicitly.

Using visual programming to perform CSG operations

Example:

Performing CSG operations without coding

You can also pass a clipping plane as one of the input objects (with intersect operation). In this case, another object will be clipped.

Limitations:

  1. Geometry of morphed or skinned object will be baked.
  2. Objects with normal mapped materials are not not supported.

add annotation

Adds a point of interest icon to an object that a user can expand by clicking on it to see some description. Also works for a list of objects, a group (or a list of groups) or with the all objects puzzle.

Add annotation visual programming block

For example, to add an annotation to the "Cube" object with "1" as label and "This is point of interest #1" as description:

Example of HTML annotations created with visual programming

You can assign custom name for the annotation object, instead of default value, equal to the annotation label. For this you need to modify the puzzle by clicking on the gear icon and setting on the checkbox enable "name" option:

Assign object name for the annoation

The add annotation puzzle creates 2 HTML elements (for label and description) which can be styled in App Manager settings or with CSS classes.

You can also style each individual annotation by assigning and accessing its elements' ids:

HTML layout of 3D annotations

By default, an annotation obscured by some geometry is automatically closed and become semi-transparent. This behavior can be disabled by turning off the fade annotations option of the configure application puzzle.

Example of annotation fading

You can use a more low-level alternative, the bind element puzzle, instead but it won't expand upon clicking and won't be obscured by geometry.

remove annotation

Removes a previously added annotation from an object. Also works for a list of objects, a group (or a list of groups) or with the all objects puzzle.

Visual programming block to remove annotations

open annotation

Expands an annotation specified by its label.

Visual programming block to open annotations

close annotation

Closes an annotation specified by its label.

Visual programming block to close annotations

create text object

Generates a new text object according to the specified textual content and parameters.

Creating text objects with visual programming

Basic options:

with text
Generated text.
font
Font used to generate text. The following formats supported: WOFF, TTF, OTF.
size
Rendered text size in engine units (depending on the modelling suite: meters, inches, etc.).
extrude
Amount of extrusion applied to text glyphs.

Advanced options:

segments
Number of segments used to render the text. Less — better performance, more — better quality.
bevel thickness
Thickness of the text bevel.
bevel size
Size of the text bevel.
horizontal align
Horizontal text alignment.
vertical align
Vertical text alignment.

update text object

Updates mesh for a text object according to specified textual content. The text object should be created either by using the create text object puzzle or exported from the modeling suite.

Updating text objects with visual programming

This puzzle also works for a list of objects, a group (or a list of groups) or with the all objects puzzle.

get object dimension

Outputs object dimensions as numberic X, Y, Z components or as XYZ vector in either local coordinate system (with scaling applied) or world coordinate system.

Get object dimension visual programming block

In the world mode, the puzzle also works for a list of objects, a group (or a list of groups) or with the all objects puzzle.

Usage example: drawing a text label which displays current width (in centimeters) for the dynamically scaled object.

Getting object dimension example

The puzzle has some limitations. For morphed objects, it returns maximum dimensions the object can be morphed to. For skinned objects, the puzzle returns the original dimensions for the object.

distance

Outputs the distance between two specified objects. Does not work with lists, groups or the all objects puzzle.

Calculate distance between two objects with visual coding

get custom props

Returns a dictionary with custom properties assigned to an object.

Get custom props visual programming block Get custom props example

Custom properties can be assigned in Blender by using the Custom Properties panel:

Exporting custom properties from Blender

or in 3ds Max by typing properties in the Object Properties dialog:

Exporting custom properties from 3ds Max

or in Maya by using the AttributesAdd Attributes... menu in the attribute editor:

Add attributes menu in Maya Attributes in Maya

In case of Maya you need to assign additional customProperties attribute with the list of space-separated custom property names.

Assigning custom properties in Maya

outline

Applies or removes the outline effect to/from a specified object. Requires enabling the outline effect in Blender, 3ds Max or Maya. Also works for a list of objects, a group (or a list of groups) or with the all objects puzzle.

Outline 3D objects with visual coding

set shadow param

Enable/disable casting/receieving shadows for the given object. Also works for a list of objects, a group (or a list of groups) or with the all objects puzzle.

Visual logic block to set shadow params

update light probe object(s)

Updates/rerenders the reflection cubemap for the given light probe object.

Visual logic block to update light probe objects

Having Troubles with Puzzles?

Seek help on the forums!