Page 1 of 5

Create random textures over instances

PostPosted: Wed May 04, 2016 1:28 am
by roeland
(This is an updated version of abstrax' script, it works in Octane 3.00 alpha 10, and Octane 2.25.)

Download here (updated on 23 May)
Texture Scatter.lua
(26.24 KiB) Downloaded 591 times


This script creates a number of random image textures, and allows you to use one of these (at random) on each instance of a mesh. It is possible to vary the input image file, and the image transform for each image texture.

scatter UI.png
Settings


scatter example.png
Small example with 10 variations


How to use:
  • The first time you run the script, pick your settings and create a new node graph.
  • To update a node graph you created earlier, select the node graph and then run the script.

Re: Create random textures over instances

PostPosted: Thu May 05, 2016 6:33 am
by smicha
Roeland,

Thank you so much for fixing the script.

There are some very important features that the script lacks of: selection of a single texture (not a catalogue) and lock for proportions scaling. Plus vertical and horizontal flip (negative scaling) - attached.

Random texture node that would work in real time is so needed. Namely it could work like this: when you connect it to the texture input it would come with a single input for a texture but with the option to increase number of inputs - exactly the same way that the geometry group works. And another random 3d transform having all parameters from LUA would be great. The schematic is attached.

Re: Create random textures over instances

PostPosted: Fri May 06, 2016 12:51 am
by roeland
OK I added those two improvements.

You can now lock the aspect ratio of the settings in the scale group, and you can also mirror the textures at random.

If you want to mirror all instances, set the scale of one of the scaling channels to negative values.

--
Roeland

(ps. that will be it for a while, I'll leave further enhancements up to you)

Re: Create random textures over instances

PostPosted: Fri May 06, 2016 7:41 am
by smicha
Roeland,

So many thanks!

Selecting images instead of folder works like a charm - great! Mirror options work great, but:

1. The most important feature - lock aspect ratio - is not well coded. Sorry, this is my fault - I should give you more explanation. So here it is: it is not about having same values in the input LUA panel, but the same values in the final UV transform for S.X and S.Y. - see the screenshot. So please add aspect ratio option to the input panel, and if a user chooses aspect ratio as 1 we shall see same values in the final UV transform for S.X and S.Y (with +- signs when the mirror is used). So the code for final S.Y may look like S.Y = c*S.X, where c is aspect ratio.

2. A bug: when I open any group in the node graph and run the script the final node occurs in the scene tab, not in the tab where I am currently in. It works only for updating the script. What I have to do is go to the scene tab, cut the node and paste it into a desired tab.

You are the man! It's almost done ;)

Re: Create random textures over instances

PostPosted: Tue May 10, 2016 9:46 am
by smicha
Any response, please...

Re: Create random textures over instances

PostPosted: Wed May 18, 2016 8:41 pm
by smicha
Guys,
Just a simple fix and this will be great. Please, please, please...

Re: Create random textures over instances

PostPosted: Sun May 22, 2016 10:49 pm
by roeland
OK I should have though that one through I guess.

Update in original post

--
Roeland

Re: Create random textures over instances

PostPosted: Mon May 23, 2016 6:45 am
by smicha
What a beautiful day :D

Thank you so so so so so much!

Re: Create random textures over instances

PostPosted: Tue May 24, 2016 3:25 pm
by franchus
Woooow! you just saved my life, I could not do this with c4d cloned instances and now it's like magic. I just loaded the script applied it to a material and saved the material in local DB, then imported the material in C4d and voilá! I'm saved by your wits!

thumbs up!
cheers!
frankie3333

Re: Create random textures over instances

PostPosted: Tue May 24, 2016 6:11 pm
by smicha
Great. The script is very powerful and has potential for further development ;)