PDA

View Full Version : Random Color/Texture



Niko3D
02-09-2015, 10:46 AM
Hi guys!
I need one help please...

How can I do for to put in a random texture one object, but it is NOT an instances, it is just in one layer and I can't re-name every single box?
I attached a very stupid example for to understand...126966

Niko3D
02-09-2015, 10:50 AM
If someone can help me would be great...Thanks!!!:)

Sensei
02-09-2015, 12:15 PM
See this video tutorial
https://www.youtube.com/watch?v=QJHSPseh8hU

This node is reading suffix of item name.

jeric_synergy
02-09-2015, 12:30 PM
Can't watch the video now (stupid Flash) but the title says "clones" while the OP said it's just a bunch of boxes in one layer, with identical surfaces --ie, not technically clones. That he can't resurface.

Asssuming the boxes are one piece, you could certainly use DPKit PART information to designate each box.--

MonroePoteet
02-09-2015, 03:38 PM
If all you want is a different color for each cube, you could use an image editor to create a very small image which has the same number of pixels in each dimension as the array of cubes. In your posted example, it would be 6 pixels by 4 pixels. Then, put a "random" color in each pixel, map it as a Y-oriented planar image, then size it up and position it to color each cube. I've attached an example (a 5x3 array) using this technique.

mTp

Niko3D
02-10-2015, 02:25 AM
See this video tutorial
https://www.youtube.com/watch?v=QJHSPseh8hU

This node is reading suffix of item name.

Wow!Really Interesting!But I don't know if it works in my case...because I can't clone the objects...the boxes was just an example...I atteched the real project for to understand better.
I have a big brick wall in just one layer and in one surface...but these brick could be in a different texture, some more darker and some more lighter...but of course I can't select one by one!eheheheh...

I was wondering if it exist some node that can do that...something like your link anyway...126973126974

Sensei
02-10-2015, 05:07 AM
See Weight Polygon Groups (http://www2.trueart.pl/?URIType=Directory&URI=Products/Plug-Ins/WeightPolygonGroups)
https://www.youtube.com/watch?v=T1DvdkvvfAo
https://www.youtube.com/watch?v=ILKNEB63vGE
It will assign each of your polygon group unique ID,
which you can use as input to Gradient.
The rest remain the same as in 1st video tutorial.

Weight Polygon Groups has option to randomize values, instead of progressing step by step. Each brick will have unique weight for entire its polys.

I understand what do you want to do. After all I was doing similar thing in this tutorial
https://www.youtube.com/watch?v=okbhuG0_9XA
but for smaller quantity of tiles..
Instead of making bricks brighter/darker, use different textures of brick (many 2D image nodes plugged to Gradient). This way it will be more realistic.

Chrusion
02-10-2015, 11:33 AM
If all the tools in Modeler were $300 per button, we'd have a $10,000.00 program! Yikes.

Sensei
02-10-2015, 11:37 AM
If all the tools in Modeler were $300 per button, we'd have a $10,000.00 program! Yikes.

That's entire pack.
Approximately 125 modeling & layout tools/commands.

jeric_synergy
02-10-2015, 05:51 PM
Huh,.... this SHOULD work, but does not. What am I doing wrong?

One layer, one surface, DPKit and a gradient (tip: save PITA-to-build gradient nodes-- this is a 'rainbow' gradient saved as a one-node network). I Merged points and it still does this (also, zero points merged).

126984

Theory is: each cube should be a (DPKit) 'part', and the part index references the rainbow gradient for assorted colors. Instead, it seems to be on a by-polygon basis....ooooo, that gives me an idea on testing what's going on....

jeric_synergy
02-10-2015, 08:48 PM
Yeah: when I subdivided, every poly gets a 'random' (not really) color.

Which is odd, because Part Info should not do that.... maybe I should DL the latest and see if this has already been addressed.

126985

gerardstrada
02-10-2015, 09:13 PM
Yeah: when I subdivided, every poly gets a 'random' (not really) color.

Which is odd, because Part Info should not do that.... maybe I should DL the latest and see if this has already been addressed.

126985
According to Denis' website:

Usage :
-Part infos are only returned if this node is connected directly or
undirectly in Part Move, Poly Move nodes inputs.

Might try with DP PartMove's index instead.

http://s14.postimg.org/uhzhrw5r3/cubitos.png



Gerardo

jeric_synergy
02-10-2015, 09:47 PM
According to Denis' website:

Usage :
-Part infos are only returned if this node is connected directly or
undirectly in Part Move, Poly Move nodes inputs.
Might try with DP PartMove's index instead.
Gerardo
Thanks for looking into this, Gerardo, obviously you've demonstrated that it can be made to work. I was looking at exactly that text when you posted.

Could you please parse this sentence for me? I'm not getting the meaning:


-Part infos are only returned if this node is connected directly or
undirectly in Part Move, Poly Move nodes inputs.

I really don't get what's being said here:

Is it that the Part Info node can only be used with Part Move?
If Part Info node is being used with another node, not Part Move, what is the 'meaning' of the Index output?
The final clause "..., Poly Moves nodes inputs" is lacking a verb. What does it mean?


There's just not enough redundancy in the paragraph to derive the meaning, at least for me.

Thanks for your help.

--I would never have figured this out because, for one, I have zero idea what the SEQUENCER node does. :(
And I'm confused as to why Part Info would be addressing the object on a polygon level -- ????.

dpont
02-11-2015, 12:06 AM
Is it that the Part Info node can only be used with Part Move?

Yes.


If Part Info node is being used with another node, not Part Move, what is the 'meaning' of the Index output?

Something which is irrelevant,
first the node is not able to detect if Part Move is present in the connection
but of course not able to provide the correct Part Index in this case,
since Parts are detected in Part Move.


The final clause "..., Poly Moves nodes inputs" is lacking a verb. What does it mean?


Typos, cleaned up.


Denis

gerardstrada
02-11-2015, 10:57 AM
--I would never have figured this out because, for one, I have zero idea what the SEQUENCER node does. :(
And I'm confused as to why Part Info would be addressing the object on a polygon level -- ????.
According to Mike's website: Sequencer takes an input integer number to output a number within the range of 0 to 1.0 (0 is not included). This can be used to create a gradient input from a polygon number....or in this case for parts. Another way to go might be probably by connecting Index output of DP PartMove to Hue parameter of a ColorTool node.

Part Info /Part Move are nodes intended to be used in Displacement NE. Being that Part infos are only returned if this node is connected directly or indirectly in Part Move, as mentioned in Denis' website, actual parts in this case (Surface NE) are detected in Part Move. If you ask me, the fact that Part Info is addressing the object in polygon level within Surface NE context is a useful thing (good discovering) because we are able to randomize colors at parts level and at polygons level with these tools.



Gerardo

jeric_synergy
02-11-2015, 05:10 PM
According to Mike's website: Sequencer takes an input integer number to output a number within the range of 0 to 1.0 (0 is not included). This can be used to create a gradient input from a polygon number....or in this case for parts. Another way to go might be probably by connecting Index output of DP PartMove to Hue parameter of a ColorTool node.
So, it's an ARBITRARY range remapper?? No, that's impossible, it'd have to.... I'll go RTFM. ;) :thumbsup:


Part Info /Part Move are nodes intended to be used in Displacement NE. Being that Part infos are only returned if this node is connected directly or indirectly in Part Move, as mentioned in Denis' website, actual parts in this case (Surface NE) are detected in Part Move. If you ask me, the fact that Part Info is addressing the object in polygon level within Surface NE context is a useful thing (good discovering) because we are able to randomize colors at parts level and at polygons level with these tools.
Gerardo
This unsupported behavior is useful (for certain values of 'useful'), but might disappear at any time when Denis recodes the node. As a (unsupported) way to differentiate polygons for Surfacing it's kind of .....interesting.

I guess I need to see some networks that are using both PartInfo and PartMove. Since they are both outputting an Index out their right side, I'm not visualizing how they'd both be applied simultaneously.

Thanks for the help Gerardo, Denis: it's been very educational, and the OP got a solution too. Win!

gerardstrada
02-11-2015, 08:52 PM
So, it's an ARBITRARY range remapper?? No, that's impossible, it'd have to.... I'll go RTFM. ;) :thumbsup:
Please, don't get me wrong, what happens is that it's always better to reference the original sources if they are available and are more clear of what I could explain. Think Remap is more like an arbitrary remapper, Sequencer is probably more like a quasi-random sequencer. Think the explanation about how it works internally is more detailed in the website (http://wiki.db-w.com/tools/sequencer).


This unsupported behavior is useful (for certain values of 'useful'), but might disappear at any time when Denis recodes the node. As a (unsupported) way to differentiate polygons for Surfacing it's kind of .....interesting.
I don't think it's unsupported, I think it's there precisely for that. Because obviously, it has no sense to keep a repeated parameter in a node unless it works differently - in this case in another context (Surface NE) - but it's not the primary function of the node (because it's a Displacement NE node).

This was mentioned (http://forums.newtek.com/showthread.php?137653-Node-math-making-n-conform-to-range-0-lt-gt-1&p=1344522&viewfull=1#post1344522) by Denis 2 years ago:

Only Part Move node does the job,
Part Info node get this information through its connection to Part Move,
so Part Info is not really interesting by itself for just colouring
with part index,

..in Surface NE as it was shown previously here (http://forums.newtek.com/showthread.php?137507-Part-Info-for-surfacing-question-Colors-per-poly-instead-of-per-part).

again you just need Part Info in Displacement for varying
the animated channels of the part.

Then, the value of usefulness of why PartInfo Index is there is just for coloring polygons.



I guess I need to see some networks that are using both PartInfo and PartMove. Since they are both outputting an Index out their right side, I'm not visualizing how they'd both be applied simultaneously.
Index from both nodes are not applied simultaneously. As we have seen, Index in PartInfo node is there to b used in Surface NE context. But the other parameters are indeed used together with PartMove in Displacement NE. Here's (http://forums.newtek.com/showthread.php?127828-Can-this-be-done&p=1241339&viewfull=1#post1241339) an example on how PartInfo can be used to offset the parts.

Then, oPos, wPos and Normal parameters get these data from the parts so that their channels can be animated, Index is there only because we can coloring polygons in Surface NE http://forums.newtek.com/images/icons/icon7.png


Thanks for the help Gerardo, Denis: it's been very educational, and the OP got a solution too. Win!
For keeping things clear it's an idea that the special usage of index parameter in PartInfo for colorizing the polygons could be mentioned in the website.



Gerardo

Niko3D
02-12-2015, 09:59 AM
See Weight Polygon Groups (http://www2.trueart.pl/?URIType=Directory&URI=Products/Plug-Ins/WeightPolygonGroups)
https://www.youtube.com/watch?v=T1DvdkvvfAo
https://www.youtube.com/watch?v=ILKNEB63vGE
It will assign each of your polygon group unique ID,
which you can use as input to Gradient.
The rest remain the same as in 1st video tutorial.

Weight Polygon Groups has option to randomize values, instead of progressing step by step. Each brick will have unique weight for entire its polys.

I understand what do you want to do. After all I was doing similar thing in this tutorial
https://www.youtube.com/watch?v=okbhuG0_9XA
but for smaller quantity of tiles..
Instead of making bricks brighter/darker, use different textures of brick (many 2D image nodes plugged to Gradient). This way it will be more realistic.

Thank you Sensei!
Your Video Tutorial are amazing and usefull!...;)

Niko3D
02-12-2015, 10:17 AM
According to Denis' website:

Usage :
-Part infos are only returned if this node is connected directly or
undirectly in Part Move, Poly Move nodes inputs.

Might try with DP PartMove's index instead.

http://s14.postimg.org/uhzhrw5r3/cubitos.png



Gerardo

Hi Gerard!
Thank you some much!Your nodes in my case works very very well...it's fantastic!...;)

jeric_synergy
02-12-2015, 11:47 AM
Please, don't get me wrong, what happens is that it's always better to reference the original sources if they are available and are more clear of what I could explain. Think Remap is more like an arbitrary remapper, Sequencer is probably more like a quasi-random sequencer. Think the explanation about how it works internally is more detailed in the website (http://wiki.db-w.com/tools/sequencer).

::read read read:: It appears Sequencer is a sort of 'hashing' scheme to guarantee that an arbitrarily large index output always results in a value 0<n<=1.0, but not a reMAPPER per se, since the value jumps around (you probably already said this above, but typing on laptop....) in a non-linear fashion. --That's interesting, and makes making gradients a bit easier. It was actually on my machine, although I don't know why.

gerardstrada
02-12-2015, 02:31 PM
::read read read:: It appears Sequencer is a sort of 'hashing' scheme to guarantee that an arbitrarily large index output always results in a value 0<n<=1.0, but not a reMAPPER per se, since the value jumps around (you probably already said this above, but typing on laptop....) in a non-linear fashion. --That's interesting, and makes making gradients a bit easier. It was actually on my machine, although I don't know why.
Have been reading a bit about 'hashing scheme' you mentioned and yes, looks like that's the idea: arbitrary input => fixed output. In this case the output, if I'm understanding documentation well, is not only an uniform random sequence but it's highly correlated, so output values never overlap or repeat. And yes, building gradients are a lot easier with Sequencer node because as you have implied. we don't need to know in advance the input range to build correctly the scale of the gradient, just set it up from 0 to 1 and input there whatever it is.



Hi Gerard!
Thank you some much!Your nodes in my case works very very well...it's fantastic!...
Glad it works Thanks to Denis and Mike!



Gerardo

Niko3D
02-18-2015, 09:41 AM
Have been reading a bit about 'hashing scheme' you mentioned and yes, looks like that's the idea: arbitrary input => fixed output. In this case the output, if I'm understanding documentation well, is not only an uniform random sequence but it's highly correlated, so output values never overlap or repeat. And yes, building gradients are a lot easier with Sequencer node because as you have implied. we don't need to know in advance the input range to build correctly the scale of the gradient, just set it up from 0 to 1 and input there whatever it is.



Glad it works Thanks to Denis and Mike!



Gerardo

Of course!
Thanks all...;)