Announcement

Collapse
No announcement yet.

VRayDistanceTex Objects - Remove multiple at once

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

  • VRayDistanceTex Objects - Remove multiple at once

    Hiya Vlado and gang,

    Sometimes I need to swap lots of geometry out of my scene due to updates/client feedback.

    When using VRayDistanceTex map, this can leave me with hundreds of <deleted> items in my Objects list.
    At the moment it seems I can only select individual objects in the list, which makes removing <deleted> items tedious.

    Because of this limitation I usually just leave the <deleted> items in the list, but over the course of a long project the list can get hard to manage.

    Is it possible to add the ability to "shift-select" multiple objects or "Remove all <deleted> objects" to the Objects list please?

    Thanks!
    Toucan Creative
    Linkedin Profile

  • #2
    Thank you very much for your feedback.
    I've already added this feature-request in our list.
    I'll update this thread as soon as we have it done.
    Svetlozar Draganov | Senior Manager 3D Support | contact us
    Chaos & Enscape & Cylindo are now one!

    Comment


    • #3
      This'll loop through any of the distance tex maps in your scenes and get rid of any <deleted> items that are in the lists - paste it into a maxscript > new script and then do file > evaluate

      Code:
      theArray = getclassinstances vrayDistanceTex
      
      for i = 1 to theArray.count do
      (
      	theMap = theArray[i]
      	for o = 1 to theMap.objects.count do
      	(
      		if theMap.objects[o] == undefined then
      		(
      			deleteitem theMap.objects o
      		)
      	)
      )

      Comment


      • #4
        Thanks Svetlozar.

        Also thanks John. I really need to pull my finger out and get into maxscript at some point.
        Toucan Creative
        Linkedin Profile

        Comment


        • #5
          Joconnel, does this script work with Max 2016? I just happened to be in a need of quickly removing a bunch of deleted objects from VrayDistanceTex but evaluating the script doesn't seem to work. I get some errors:
          Code:
          [COLOR="#0000FF"]#(Map #2070297468:VRayDistanceTex)[/COLOR]
          [COLOR="#FF0000"]-- Error occurred in o loop; filename: ; position: 227; line: 10[/COLOR]
          [COLOR="#0000FF"]--  Frame:
          --   o: 15[/COLOR]
          [COLOR="#FF0000"]--   called in i loop; filename: ; position: 236; line: 12[/COLOR]
          [COLOR="#0000FF"]--  Frame:
          --   i: 1
          --   theMap: Map #2070297468:VRayDistanceTex[/COLOR]
          [COLOR="#FF0000"]-- Runtime error: array index out of bounds: 15[/COLOR]
          I wish we could have an option to quickly remove deleted objects from lists. Maybe in the next SP?
          Aleksandar Mitov
          www.renarvisuals.com
          office@renarvisuals.com

          3ds Max 2023.2.2 + Vray 7 Hotfix 1
          AMD Ryzen 9 9950X 16-core
          96GB DDR5
          GeForce RTX 3090 24GB + GPU Driver 566.14

          Comment


          • #6
            what might be happening is as it's running the length of the list of objects is getting smaller but the code is using the original length of list and trying to access things that don't exist anymore. I'll recode.

            Comment


            • #7
              That's a lot of code John-boy.....

              Code:
              for o in getclassinstances VRayDistanceTex do o.objects = (for obj in o.objects where obj != undefined collect obj)
              Maxscript made easy....
              davewortley.wordpress.com
              Follow me here:
              facebook.com/MaxMadeEasy

              If you don't MaxScript, then have a look at my blog and learn how easy and powerful it can be.

              Comment


              • #8
                Brilliant! Thanks Dave, works like a charm.
                Aleksandar Mitov
                www.renarvisuals.com
                office@renarvisuals.com

                3ds Max 2023.2.2 + Vray 7 Hotfix 1
                AMD Ryzen 9 9950X 16-core
                96GB DDR5
                GeForce RTX 3090 24GB + GPU Driver 566.14

                Comment

                Working...
                X