Announcement

Collapse
No announcement yet.

Random material id color increment issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Random material id color increment issue

    Hi,

    my client like to use material id color masks and ask me for a better separation of the colors. Please could the the algorithm so optimized that the colors are more separated? Here an example - the seat cushions should be more clear separated.

    (I start to use non automatic generated mat id colors but it's a lot of work to add the attributes.)

    -Micha

    Click image for larger version

Name:	Screen Shot 06-25-21 at 11.10 AM.JPG
Views:	246
Size:	52.0 KB
ID:	1117700
    www.simulacrum.de ... visualization for designer and architects

  • #2
    Hi, it is true that the randomizer is not randomizing very randomly, and that is probably, because it is time-based. You can quickly script a new pseudo randomizer on python

    Code:
    import rhVRay as vray
    import math
    import random
    
    vray.Scene.BeginChange()
    
    for m in vray.Scene.PluginsByClass("MtlMaterialID", False):
        clr = int(math.floor(random.random() * 16777215))
        m.material_id_color = [float((clr >> 2) & 0xFF)/255.0, float((clr >> 1) & 0xFF)/255.0, float(clr & 0xFF)/255.0]
    
    vray.Scene.EndChange()
    This can be written in more elaborative way, of course.
    The other way around is to use a dictionary of predefined colors.
    sites like http://randomcolour.com/ (and many others) can generate a list of let say 1000 colors, which you can save to file, and with another very similar script like the one above, apply them to your materials.

    Cheers
    Last edited by nikolay.bakalov; 27-06-2021, 10:04 AM.

    Comment


    • #3
      My hope was to get better randomized color for the automatic generated color of the "material random color" channel. I suppose so this wish which could be released by the core team only.

      Thank you nikolay.bakalov Your script looks promising for the standard material ID color channel. Could you please provide a little script which add a material ID attribute to every material? So it could be easier to switch from the automatic random color to material ID color.
      www.simulacrum.de ... visualization for designer and architects

      Comment


      • #4
        Adding a material ID attribute actually slots the source material within another material plugin, a MtlMaterialID.
        The V-Ray for Rhino API currently does not support material creation thus the second part of your request is unachievable.

        Your suggestion to improve the distinction between color IDs is logged and awaits evaluation and prioritization.

        Kind regards,
        Peter
        Peter Chaushev
        V-Ray for SketchUp | V-Ray for Rhino | Product Specialist
        www.chaos.com

        Comment


        • #5
          Today I got a material random color there I can't separate the materials because the colors was equal or to similar. Please add a tool to add the classic material ID color to each material. It would be great to get control over the material colors without manual adding the channel to dozen of materials of a complex scene.
          www.simulacrum.de ... visualization for designer and architects

          Comment


          • #6
            Hello Micha

            Like we discussed in our correspondence, I am sharing the approach I suggested to you here as well - Utilizing the command "_vraySetMtlID 0" (followed by what should be two 'Enter' keys) will assign the Material ID attribute to the available materials simultaneously.
            This can be a very easy and quick approach in cases where there is a rather long list of materials and all or most of them need to have this attribute.
            Zahari Ivanov | chaos.com
            Chaos Support Representative | contact us

            Comment


            • #7
              Thank you for your support. I have just made another discovery. When I call the command "Randomize Material ID colors" from the V-Ray menu, a Mat ID channel is added to all materials. Definitely something that needs to be on the help pages.
              www.simulacrum.de ... visualization for designer and architects

              Comment


              • #8
                You are correct, thanks for noticing!
                The command description in our Docs portal is not updated yet as the change was considered overall to be a bug fix. Some additional adjustments will be implemented with an upcoming update which will prompt a description change.
                So far only the following line was added to the v6.00.02 release notes:
                • The workflow when using the vraySetMtlID command is improved. It now affects all V-Ray materials and ensure a Material ID attribute is applied to each one

                Peter Chaushev
                V-Ray for SketchUp | V-Ray for Rhino | Product Specialist
                www.chaos.com

                Comment

                Working...
                X