Object iD

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Post Reply
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Object iD

Post by Fox »

What is the object iD in node editor?
Is there way to feed band texture values randomly to objects?
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Object iD

Post by B.Y.O.B. »

It allows you to access the object ID in a material.
By default, object IDs are assigned by hashing the object name (so you get a seemingly random, but stable value). But you can also assign custom object IDs in the latest v2.2beta1 (in the object properties in Blender).
The object ID is a 4 byte unsigned int.

There are three modes:
- Color: the lower 3 bytes are interpreted as R, G, B values -> you get "random" colors
- Normalized: the returned value is in the range 0..1 -> you get "random" grayscale values
- Raw: you get the raw object ID (range 0..0xffffffff), this is for power users who want to do their own calculations
Fox wrote: Sat May 04, 2019 4:12 pm Is there way to feed band texture values randomly to objects?
You can plug the output of the "normalized" mode into a band texture input - is that what you mean?

Attached is a small example showing the three modes.
Attachments
object_id.jpg
object_id.blend
(108.73 KiB) Downloaded 107 times
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: Object iD

Post by Fox »

This is so cool, i can use it for pool tiles, with some blender noise texture + band texture in between.
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: Object iD

Post by Fox »

Aa i see now, to map object id's in the shape of some procedural texture is not possible.
I have the random colors with little texturing, the tiles look pretty good already as is.
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Object iD

Post by B.Y.O.B. »

You only need the object ID if you want to use the same material on multiple objects, but still have variation between the objects.
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: Object iD

Post by Fox »

I can make 2 object/ material groups via visible selection through procedural displacement.
One white gray shade tiles.
Another blue shade tiles.

But the tiles would have to be little smaller.
2 groups for pool tiles.jpg
Fox
Posts: 437
Joined: Sat Mar 31, 2018 11:17 am

Re: Object iD

Post by Fox »

I got it done with boolean modifier, the object id has now 28000 tiles in 3 material groups.
Pool tiles boolean mod.jpg
Post Reply