dudintv / vizartist-scripts

Scripts for using in Vizrt Artist
7 stars 1 forks source link

Random position script problem #1

Closed cvelele closed 2 years ago

cvelele commented 2 years ago

Whole script pare is excellent.

1. I use your Array to lines script to spread 100 cubes in 10x10 layout. Then I wanted to apply Random position script to same group to randomly move this 100 cubes up/down. But it moves whole group up/down. Is it possible to modify script in future, to be able to work on group elements randomly (also for Random scale and Random rotation)?

2. Since this didn't work for group then I apply Random position on group element. But script then move cube from his original position on 0,0,0 position. I found this in code:

sub OnInitParameters() RegisterParameterDouble("pos_x", "Position X", 0, 0, 999999) RegisterParameterDouble("pos_y", "Position X", 0, 0, 999999) RegisterParameterDouble("pos_z", "Position X", 0, 0, 999999)

(think there is typo error for pos_y write Position X and for pos_z Position X)

where position are reset to 0,0,0. Question: can script read current position of elements and not reset to 0,0,0? I am not good in programming so if you could update the script it would be great.

Thx

dudintv commented 2 years ago

@cvelele hi and thank you for the feedback! I'm on vacation and I didn't notice that I have a comment there :)

  1. Smart idea! I'll make them.

Btw, I already have a script for random shaking children, but it works only with Y axis. I've just translated everything there to English for you:

https://github.com/dudintv/vizartist-scripts/blob/master/dudin-transform/dudin-random-move-array/random-move-array.vb

  1. Unfortunately I can't save original position of containers and more around these positions. It's not possible to guarantee keep original positions. I can't apply any additional transformation to tree containers. Only one way how you can work with this — wrap every child by one more container and move (apply this script) on the inside container, around (0,0,0).

Thank you for the review! I'll fix the names.

dudintv commented 2 years ago

@cvelele I've rewrited the script of moving array of containers! ;)

Please check: https://github.com/dudintv/vizartist-scripts/tree/master/dudin-transform/dudin-random-move-array

You can specify which container (by name) you want to randomly move: 2022-09-02_20-15-18 in this example I used "#star" name

dudintv commented 2 years ago

2022-09-02_20-17-03 this is the settings for the array of stars:

2022-09-02_20-16-48

cvelele commented 2 years ago

Ha ha, now was my time to go vacation, but I am back. Thanks for updating dudin-random-move to dudin-random-move-array. I successful apply plugin and works great. Now for scale and rotation, if you have time, no rush.

Excellent script collection. Many thanks.