MoI discussion forum
MoI discussion forum

Full Version: MoI scatter tool

Show messages:  1-20  21-31

From: Max Smirnov (SMIRNOV)
1 Feb 2014   [#1]
MoI Scatter tool - is a set of scripts that allows you to create instances of an object and place them in the scene.
I wrote these scripts to use with Octane render only, but later I wrote vClone script which makes possible to use this scattering system in MoI.

Ok, let's go.
But first of all, I'd like to explain a few things.
Vectors:
I use vectors to set the positons of scattered objects.
Each vector is a single line with 2 points: start (base) point and end (destination) point.
Start point of a vector determines an origin of coordinate frame. End point determines a direction of the elevation axis (I've decided to not use a triangles)
Length of a vector determines the scale factor (default length is 1. It doesn't matter which unit system is used )

Scripts:

1. vDrop
Drops vectors on underlying surfaces.
Usage: Select vectors and surfaces. Run script.
Note: Vectors must be placed above the surfaces. You can use surfaces, joines surfaces, solids.




2a. vOrient
Orients vectors, aligning the vectors to the surface normal.
Usage: Select vectors and a surface.

2b. vOrientFast
This tool works exactly as vOrient. It's up to 80% faster, but it doesn't work if the vectors is very close to the surface. But in some cases it can save your time, especially when you process a large amount of vectors.




3. vSpray
Spreads vectors across a surface.
It works similar to spray tool in photo editors. This script perfectly works with both perspective and parallel view projections.
Usage: Select face or surface. Push and spray.
Hints: You can use zero or negative vSize values.




4. vSeed
Generates vectors along a set of curves.
Usage: Select vectors and a surface to align (optionally)
Note: If no surface selected, the vectors will points upward. Zero or negative vSize values is also acceptable.




5. vClone
Using this script, you can replicate an object in the scene.
Usage: Select object, set the object's orientation, select vectors for object replication.
Note: This is a beta version of the script. Scale factor is not yet supported.




6. SaveInstances
Exports data to csv file. This file can be used with Octane render, to create a large amount of object instances.
I'll write separate post about this script.

-------------------
UPDATES:
vSeed 1.2 2014.02.05
[Fixed] Performance issue
[Added] Points support
From: BurrMan
1 Feb 2014   [#2] In reply to [#1]
Very cool Max. Thanks!
From: bemfarmer
1 Feb 2014   [#3] In reply to [#1]
The scripts look very cool. I will need to study these later.

How might the randomize script fit in?

Is a value for the surface normal obtainable?

Is the slope and curvature of a line obtainable?

- Brian
From: Max Smirnov (SMIRNOV)
1 Feb 2014   [#4] In reply to [#1]
In this post I'll tell about saveInstances script.
As I said above, with this script you can prepare data for Octane render. This data can be imported in Octane Render and loaded to the 'Scatter' node.

Here is an example of using this script.
I created a group of vectors (upper left corner) and replicated it along the curve using Array-curve tool. (total: 8900 vectors)


Let's select one group and see how the script works.

UI:
Filename.
If no 3dm-file has been loaded or saved yet, its value is instances.csv, and it will be saved in the current folder. If file is open, the script gets name from the 3dm-file. In this case, the file will be saved to that location.
Target units.
Here you can set a unit system for exporting. Octane render uses meters as a unit system. So default value is "m", but you can choose any value you want.

Other settings adds some randomness to regular distribution:
If all values is set to 0, the script exports exact positions for all objects


FB (Front/Back) - random X-shift
LR (Left/Right) - random Y-shift


UD (Up/Down) - random Z(elevation)-shift


Roll - random rotation around X-axis
Pitch - random rotation around Y-axis


Yaw - random rotation around Z-axis


Scale

From: Frenchy Pilou (PILOU)
1 Feb 2014   [#5]
A very cool new one's)!

About v_tools!

Only _vClone works for me!

All other appear one second and disapears as soon as on the Dock Menu !!!
idem for _saveinstances ! :(
From: BurrMan
1 Feb 2014   [#6] In reply to [#5]
Frenchy,
Be sure you make an array of little lines above your surface. Be sure to select "both" the lines, and the surface, then run the script. Seed needs curves too.
From: Michael Gibson
2 Feb 2014   [#7] In reply to [#1]
Really cool set of tools, Max - thanks very much for posting them!

- Michael
From: Frenchy Pilou (PILOU)
2 Feb 2014   [#8] In reply to [#6]
@Max

Do you say that I must select something before run the plugins?

Edit ok that was that! :) Excellent!

So you must put an alert message "Select something before run this plugin"! ;)

About the spray: Why lines are not perpendicular to the surfaces ?
If i take a cube only top & bottom surface have the lines on the good direction :)
And if I select a lateral face and the vertical lines result vOrient don't work!
From: coi (MARCO)
2 Feb 2014   [#9]
Hi Max!

This is just wonderful!

Thanks a bundle,
Marco
From: Max Smirnov (SMIRNOV)
2 Feb 2014   [#10]
Brian
>>Is a value for the surface normal obtainable?
No.
>>Is the slope and curvature of a line obtainable?
No.
I used arraygem and arraycurve tools.
It would be great if Michael will make a getNormal method.

Frenchy Pilou
>>Do you say that I must select something before run the plugins?
Look at the first script description
Usage: Select vectors and surfaces. Run script. ;)

>>So you must put an alert message "Select something before run this plugin"!
:)) No. I don't want to add a pop-up alerts, or any other waste code to these scripts.

>>About the spray: Why lines are not perpendicular to the surfaces ?
If i take a cube only top & bottom surface have the lines on the good direction :)
They must not be perpendicular. Vectors always points up or down, depending of camera position.
I can implement orientation code, but I won't do it, because it significantly downgrades performance of the script.

>>And if I select a lateral face and the vertical lines result vOrient don't work!
vOrient don't work with faces. You can use surfaces or solids.


From: Frenchy Pilou (PILOU)
2 Feb 2014   [#11] In reply to [#10]
Drop don't work in Horizontal ?




<< Vectors always points up or down, depending of camera position.
if I modify the camera position on the 3D view by rotate the view it's always not working!

OK I must select lines + surface then make 90° Rotation then Drop then make rotation - 90°
but...
From: DannyT (DANTAS)
3 Feb 2014   [#12] In reply to [#10]
Excellent stuff there Max! Thanks for sharing.

What I, and I think others would really like to know is the set up of your 'Ext script' icon, maybe a seperate thread.

Thanks in advance!
From: Andrei Samardac
3 Feb 2014   [#13]
Looks like hair system for MOI)!
From: bemfarmer
3 Feb 2014   [#14] In reply to [#12]
Just learned this:
In the video, selecting the "gear" icon permits setting the video to 1440 HD.

Zoom Windows7 with Ctrl+ to 400%.
Enlarge video window.
Scroll to see the modifications to the MoI screen.
From: Frenchy Pilou (PILOU)
3 Feb 2014   [#15]
Seems we can drop others things than vectors with more or less results :)


From: Frenchy Pilou (PILOU)
4 Feb 2014   [#16]
You speek about Scale for Clone : does it possible to have a random factor ?

First 5 scripts (translation of menus is not yet made : I wait the final release ;)

French version ;)

http://moiscript.weebly.com/dispersions.html


From: Max Smirnov (SMIRNOV)
4 Feb 2014   [#17]
Frenchy Pilou
>>OK I must select lines + surface then make 90° Rotation then Drop then make rotation - 90°
Just updated vSeed to version 1.2.
Now you can spray points, and then use vSeed.

>>Seems we can drop others things than vectors with more or less results :)
:)))
I didn't know about that!

>>You speek about Scale for Clone : does it possible to have a random factor ?
I can make it right now, but I have some problems with history update of scaled objects

>>French version ;)
Great! Thank you!
From: Frenchy Pilou (PILOU)
5 Feb 2014   [#18] In reply to [#17]
<<OK I must select lines + surface then make 90° Rotation then Drop then make rotation - 90°
<<Just updated vSeed to version 1.2.
<<Now you can spray points, and then use vSeed.

Sorry
Even with the new seed and with a spray i obtain that!
And same if i select Top , Side, or Same face for give orientation i obtain always vertical lines!


Edit : Curious that works if I offset the face of Cube!



So it is not a "drop" , I must no clone the result ;)
From: Max Smirnov (SMIRNOV)
5 Feb 2014   [#19] In reply to [#18]

From: Frenchy Pilou (PILOU)
5 Feb 2014   [#20] In reply to [#19]
Aaaah thanks! :)
But at least face after face for the vseed!

Show messages:  1-20  21-31