PDA

View Full Version : Random colouring parts with DP Kit - not working ?


adk
07-28-2010, 09:53 PM
Heya folks ...

Can someone confirm if this technique,

http://www.newtek.com/forums/showthread.php?t=99481

still works for them?

No matter what I try I can't get it to work like it used to & the input for the second gradient becomes a mixture of Part Info & X-coordinate ?

Cheers.

(Using latest DP Kit 07/01/10 & LW 9.6 x32)

dpont
07-29-2010, 01:18 AM
Part Info node can only get part index
from Part Move node, it must be connected
to the Part Move node,
'thinking nodal', read the 'node chain' from
root input to Part Info and see if it meets
the Part Move node.

Denis.

raw-m
07-29-2010, 09:51 AM
Hi all, I'm trying to do the same and getting results the same as you, adk. Did you find the answer? I've followed the linked post to the letter and it only seems to effect one of my cloned objects, the rest staying as X-coordinates.

dpont
07-29-2010, 04:04 PM
...Part nodes are for group of connected poly
belonging to the same object, not for cloned object,
Part is also the term used in HardFX rigid body
to define these groups.

About 'X-coordinate', I think this is just the default
behaviour of Gradient node, if the connected input
failed and returned an undefined value.

The first connection in the ADK's animation
is correct, going through the Part Move node,
don't forget that Part Info node is readonly,
Part listing is done in Part Move node.

Denis.

adk
07-29-2010, 07:14 PM
Cheers for your explanations & time Denis, & raw-m for testing. They help but I still can't seem to get it to behave like I'm sure it used to. Unless I'd doing something really stupid.

In my case the cubes are one layer & each 6 faces are connected polys (not cloned in layout). All I simply want to accomplish is to randomly colour each discrete cube as per the setup on that thread I posted above. Funny thing is I'm 99.99% sure it used to work for me before but now it doesn't seem to so I'm wondering if something in this setup has changed or if it's on my end (usually the most likely scenario :) ) ?

Alternatively, what node setup do I use to get the same result as the second last image on that thread, where each cube has a different colour.


Cheers a bunch.

dpont
07-30-2010, 01:41 AM
Part Info node is originally dedicated to Displacement
node editor, using it exclusively in Surface node editor
in relation with Part Move node could fail with multiple
F9 render (works only for first render or F10 successive
frames), but I noticed that it works for every render if
Part nodes are present in a Displacement node setup..(!?)
Not sure to be able to fix this.

Denis.

dpont
07-30-2010, 03:03 AM
...Seems to be fixable and as I said Part Move needs
to be present of a Displacement setup, probably
an update of DPKit soon (have some other things
to solve before),
below is my setup to get a combination of
various color for both parts and polygons,
at least it works for the first F9 render,
it uses also the dbw Extended Spot Info.

86858

Denis.

dpont
08-01-2010, 03:48 PM
I updated the x32 version of DPKit,
Part Info and Part Move node index output
is no more locked in Surface NE, if there's no
Part node setup in Displacement NE.

Denis.

adk
08-01-2010, 09:18 PM
Thanks a million for your time & effort in looking at this Denis :thumbsup: works perfectly now with both those setups. Greatly appreciated.

adk

raw-m
08-02-2010, 03:35 AM
Legend! Many thanks. Has the mac version been updated as well (it looks like and old date)?

Mark

K-Dawg
08-09-2010, 12:28 PM
Sorry, I still haven't understood the process.

I have an object set up with Node Item Motion. I use Points set up in Modeler where I want the Cloned Object to be.

Now that process works fine. The next step I'd like to do is give each Object a different UV Texture. I set up a DP Item Info Node, Gradient, 2d Image Node (with UV map/Image).

Now what I did is, take the item ID from Item Info, put it into the Gradient "Input" socket, setup my UV Map in 2D Image Node, connect that to Key output 1, setup a new 2D Image UV, put that in Output 2 and so on.

When I do a render (after cloning the object) I always have the same surface. It never switches to the other UV maps.

I hope you understand what I'm wanting to do.

Could someone help me out with a fool proof explanation?

Latest DP Kit (Item motion etc.) LW x64.

Greetz

Lightwolf
08-09-2010, 12:32 PM
Legend! Many thanks. Has the mac version been updated as well (it looks like and old date)?

Mark
No, I only got the source code recently and due to travels can only access the iMac again starting today.

I'll compile it in the next few days (there's a bit of catching up to do).

Cheers,
Mike

K-Dawg
08-09-2010, 04:41 PM
Hi there.

I wanted to post a screener to show what I went for.

As you can see, I used an Item Info set to "Self" to get the Item ID after Cloning.

My result though is the last Color from the Gradient. I don't get the Cycle starting with my UV.

Don't get confused by the setup. I'm using the UV i want to use, the Planks and the colors are just there to see if/when the setup works.

Greetz

adk
08-09-2010, 07:14 PM
K-Dawg ... not 100% sure this is what you're trying to achieve.

This scene has one teapot cloned multiple times in Layout.
Teapot has 3 different UV's (each with different image applied) that simply repeat as you clone more objects.

I used James Willmott's Object ID node that you can find here ...
http://liberty3d.com/tag/james+plugins/

Is this the setup that you're after ?

PS: You could also do a similar thing with a filter in Lightwolf's shadermeister :thumbsup: Mike

Lightwolf
08-09-2010, 07:22 PM
PS: You could also do a similar thing with a filter in Lightwolf's shadermeister :thumbsup: Mike
Or the Extended Spot Info in conjunction with the Sequencer node for pseudo random shuffling if you have a lot of items in the scene (both from the free db&w tools).

Cheers,
Mike

adk
08-09-2010, 07:27 PM
Or the Extended Spot Info in conjunction with the Sequencer node for pseudo random shuffling if you have a lot of items in the scene (both from the free db&w tools).

Cheers,
Mike


So many options .. so little time to test them. Cheers for the tip Mike :thumbsup:

K-Dawg
08-10-2010, 05:00 AM
Thx for the infos guys.

@ adk
Yeah, thats kinda the result I'm looking for.

I'm having problems with the ObjectID Node. When I want to import it to Layout, I get the "Plug-in not found or added" Error. Does anyone maybe now why?

I DL the 64bit one. Using LW 64 and Vista 64.

http://208.109.87.135/artists/videos/james/ObjectID_x64.zip

@ Lightwolf
How exactly do I use the nodes? I took the Extended Spot Info and the Sequencer Nodes, tried both Object outputs plugging them in the sequencer that runs into the Input of a Gradient Node.

I don't get the result I'm looking for. The Objects all get the same color and thats the last color in the Gradient Node. :stumped:

Any way, thx for your help guys. I'm slowly getting somewhere I think :D

Greetz

Lightwolf
08-10-2010, 05:06 AM
@ Lightwolf
How exactly do I use the nodes? I took the Extended Spot Info and the Sequencer Nodes, tried both Object outputs plugging them in the sequencer that runs into the Input of a Gradient Node.

I don't get the result I'm looking for. The Objects all get the same color and thats the last color in the Gradient Node. :stumped:

The Sequencer Node always outputs numbers in the range from 0..1 - that's what your gradient should cover.

Cheers,
Mike

K-Dawg
08-10-2010, 05:14 AM
So in other words, True or False?

Or is it like 0,1,2,3 etc.?

My Gradient is setup with 6 Markers set to "Step" and having a color each or a Image 2D with the UV Texture setup in the color inputs.

Hm, I'll have to try again.

Thx

Lightwolf
08-10-2010, 05:27 AM
So in other words, True or False?

Or is it like 0,1,2,3 etc.?

Neither... a floating point number between 0..1, but one that is identical for every value entered into the Sequencer on subsequent runs. It's a pseudo random number.

So more like the following values: 0.1, 0.8, 0.2, 0.3567, 0.9342, etc...

It only makes sense if you need random colours/surfacing that is consistent (it was initially designed to generate RGB mattes as a replacement for object/surface ID buffers).

Cheers,
Mike

K-Dawg
08-10-2010, 05:32 AM
Oh I understand now. Floating point. Ok not too difficult I think. I should be able to just use the values in the Gradient Node as 0, 0.1, 0.2 etc.

I wish the ObjectID Node would work to see if that is more what I'm going for. I mean, your Nodes are great for randomness, kinda like HD Instance stuff (which I can't afford) and will come in use, thats for sure :)

Greetz

Lightwolf
08-10-2010, 05:34 AM
Oh I understand now. Floating point. Ok not too difficult I think. I should be able to just use the values in the Gradient Node as 0, 0.1, 0.2 etc.

I wish the ObjectID Node would work to see if that is more what I'm going for. I mean, your Nodes are great for randomness, kinda like HD Instance stuff (which I can't afford) and will come in use, thats for sure :)

You can always use the Object number directly (which outputs the same value as James ObjectID node).

Cheers,
Mike

K-Dawg
08-10-2010, 05:40 AM
Ok just tried it. Works great. Thx for the info about the output. :)

I was about to ask that :) So I can use your Extended Spot to get the Object that was Cloned using "Node Item Motion" to control the the Gradient so I know which Object will get the desired Texture?

I tried that with the Gradient set to 1,2,3, etc and connected the Object output from the Spot Node. I didn't get the desired result though.

So as I understand, you say I get the Object Number (like 1,2,3 etc) from the Node and can use that with the Gradient?

OK I'll try again. I hope this works so I can go to the next Step. :)

Greetz and Thx

EDIT:
Hm, thats what I've been trying before and I do get a result, but the result is all objects get the last Texture/Color from the Gradient node and not the assigned Texture/Color controlled by the Gradient based on Cloned Object.

But I'm getting closer.

Lightwolf
08-10-2010, 05:43 AM
So as I understand, you say I get the Object Number (like 1,2,3 etc) from the Node and can use that with the Gradient?
You do, but it's actually the object number in the complete list of objects used by Layout.
But, getting the clone number -> i.e. "Object (##)" (returning 0 if there isn't one), would actually be a nice feature request ;)

Cheers,
Mike

K-Dawg
08-10-2010, 05:45 AM
Oh ok. That means I would have to use the Object ID from Lightwave itself and put that in the Gradient.

How do I find that ID out? Hm, that means I gotta be careful later on when I'm finished with every thing then clone the Objects (which a many) without losing the ID.

Thx Mike

Lightwolf
08-10-2010, 05:50 AM
Oh ok. That means I would have to use the Object ID from Lightwave itself and put that in the Gradient.

How do I find that ID out? Hm, that means I gotta be careful later on when I'm finished with every thing then clone the Objects (which a many) without losing the ID.

The object ID is basically the (sequential) number + a high value to flag it as an object (as opposed to a camera or bone).

I believe the new scene editor displays it.

Cheers,
Mike

K-Dawg
08-10-2010, 05:58 AM
Thx Mike. I'm getting somewhere now.

Well I dunno if the new Scene Editor shows Object IDs. Either I can't find the Setting for it, or it isn't available. Same with the flyout Menu at bottom of UI. I think it's the Item List Menu. Can't see it there either. I can sort the Items in the List by Object ID, but couldn't see the ID itself :(

Now I gotta find out what is wrong with the ObjectID Node. Is it normal that the plug-in file for x64 is only 51k ?

Anyway, thx a bundle Mike

Greetz

Lightwolf
08-10-2010, 06:11 AM
Now I gotta find out what is wrong with the ObjectID Node. Is it normal that the plug-in file for x64 is only 51k ?

That's fairly reasonable for a simple node, yes.

Cheers,
Mike

Lightwolf
08-10-2010, 06:12 AM
Well I dunno if the new Scene Editor shows Object IDs.
Properties->Item: Names and Statistics, last column.

Cheers,
Mike

K-Dawg
08-10-2010, 06:24 AM
Cool thx.

I really appreciate your help Mike, but I guess I have to bug you with something else now. 8~

The ID of the Objects are (for now) 100000e3, 100000e5,100000e7 and 100000e9

How do I use that in the Gradient Node? :question:

Greetz

Lightwolf
08-10-2010, 06:33 AM
Cool thx.

I really appreciate your help Mike, but I guess I have to bug you with something else now. 8~

The ID of the Objects are (for now) 100000e3, 100000e5,100000e7 and 100000e9

How do I use that in the Gradient Node? :question:

Greetz
They're hexadecimal numbers, the 1 at the beginning is what masks them as objects.
The Object number output in the Extended Spot Info will return the ID without that mask, so that'd be 0xe3, 0xe5, 0xe7 and 0xe9 (0x is the notation for a hey number).
In decimal that's: 227, 229, 231 and 233 (The Windows calculator can convert from hex to decimal).

However, if you're only concerned about (pseudo) random colouring, then the Sequence Node should do a decent enough job of that.
You only need the values if you want to target a specific item (incidentally, if you excuse the plug, shaderMeister comes with a few nodes that make that a lot easier).

Cheers,
Mike

K-Dawg
08-10-2010, 06:51 AM
Wow thx Mike.

Yeah, with the Randomizing this works perfectly. I do want specific Textures on specific Objects though.

Now that is a big work around, but it does the job and thats what I'm after.

I'M sure the plug-in Shadermeister is great, unfortunately i have no extra cash for it.

Maybe someday I will be able to purchase it.

Many Thx for your help Mike

Greetz