Hello Ventuzians!
THE FORUMS ARE CLOSED!

Please join our discord server HERE!! << click me :D

We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server

Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!

Instantiating a new/predefined node

Q and A about functionality and how to solve a special task for your application.

Moderator: Support

Post Reply
Luke47921
Posts: 32
Joined: 21 Oct 2015, 13:23

Instantiating a new/predefined node

Post by Luke47921 » 04 Nov 2015, 13:40

Is there a way to instantiate a node in Ventuz through a script? Similar to unity's instantiate function (http://docs.unity3d.com/ScriptReference ... tiate.html).

For example if i wanted to create a rectangle at a position where i click, how would i do this?

User avatar
Eric_RD
Posts: 103
Joined: 04 Jun 2014, 14:01
Contact:

Re: Instantiating a new/predefined node

Post by Eric_RD » 05 Nov 2015, 16:30

Short: No

Long:
There is a function called "Interface" at hierarchy and content containers.
http://www.ventuz.com/support/help/V4_0 ... Interfaces
If Interfacing is selected you can copy-paste the content of one container into another
Everything in the 2nd container is changed except for exposed values

With this in combination with the container Info (name + Index) helbs you to get some kind of instance.

Say you want do a coverflow.
You use a DIR node to get all the cover-images from one Folder
now you make as many hierarchy containers as the maximum amount of images could be with an index from 00 to max.
Now in each container you expose the input of an array indexer and link the "index start" to the name index of the container info node and connect the output of this indexer to the texture loader
Then you copy the Container and paste it with ctrl+shift +v or (paste container content menu button) into every other container
now connect the result array from the DIR node to every exposed "array" container input.
Now each container loads a different image.

now hen you change something in one of the containers (like adding a translation based on the name index, or blocking the container if there are less images then containers (container id<Count from DIR)) you just have to paste it again on all other containers and all connections stay alive

There are a few negative sides of this:
the number of these Containers is not dynamic if there are more images then containers only the first images will be displayed.
If you have a lot of containers you soon have a jungle of connections
All containers have to be validated if any input changes

I hope I could help a bit..

Luke47921
Posts: 32
Joined: 21 Oct 2015, 13:23

Re: Instantiating a new/predefined node

Post by Luke47921 » 11 Nov 2015, 17:41

Thanks for the reply Eric, although that's all a bit complex for me, for now I think I'll just stick to moving in an object from an off-screen position using scene data!

Post Reply