Announcement

Collapse
No announcement yet.

randomise vertex positions.

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

  • randomise vertex positions.

    im trying to do as title.


    i found this page and script:

    http://josbalcaen.com/maxscript-vertex-randomizer/


    which seems to do what i want (jitter vertex positions as a really hacky quick way to solve double face flicker)

    however when i feed it a 1.6 million poly mesh to crunch through, it maxes out 72GB of ram and cpu usage drops to zero.

    id suggest that was a *touch* excessive.

    any of you scriptheads have a suggestion to modify that script or an alternative? all i want to do is randomly shift vertices a few mm in a big model.

  • #2
    noise modifier / displace modifier with a noise map at tiny amounts?

    Comment


    • #3
      but then if the vertices share a position they will be moved the same. ..?

      i need all vertices moved completely randomly.

      basically trying to offset slightly a bunch of nasty doublefaced geometry. i dont care wether it slightly changes the look of the model (its very detailed, and viewed from quite far away)
      i just need a solution that is quick and doesnt involve any modelling.

      secondary ray bias doesnt fix it.. so i figure jittering the vertices a few mm (its a cluster of towerblocks) will have minimal visual impact, but make any shimmering coplanar faces stop their dancing.

      Comment


      • #4
        hm i just tried another suggested script.. it too slid slowly up past 64gb ram (slower than the last one but heading the same way.. i cancelled it.. seems quite a strangely ram intensive thing to do! )


        i also tried on a 300k vertex model.. looked like it was gonna max out he ram on that too.. how bizarre.

        Comment


        • #5
          I'd to process a mesh to remove tiny screw heads from a warehouse full of crates and had to use maxscript too - I found it way better to split the mesh off using detach in edit poly first rather than putting the lot through a script. Maxscript's single threaded so it'd murder you for something as big as you're doing! You'd nearly be better off with multiple max sessions and different cpu affinity in task manager each doing a small section of the detached mesh :/

          Thinkbox genome or mcg would be an option too?

          Comment


          • #6
            blimey. it even maxes out 72GB trying to do it on a 200k face object. thats insane. how much do i have to chop the damn thing up?!

            Comment


            • #7
              You could maybe try turning off the "Undo" in 3ds Max; it's probably doing a snapshot of the mesh after each vertex change so that it can be undone...

              Best regards,
              Vlado
              I only act like I know everything, Rogers.

              Comment


              • #8
                ok this is ridiculous.. there must be a way to do what i want.

                - tried disabling undo, but it didnt make any difference.

                i had the idea to do a random 50% vertex selection, apply a very small noise, invert the selection and do another noise with a different seed.. repeat this a few times and im fairly sure most of the vertices would have been moved apart..

                BUT with graphite tools, i tried to do a random vertex selection on my 1.6 million poly mesh. its been thinking for 45 minutes!!!

                how can something so simple be so hard?

                Comment


                • #9
                  If you are on max 2016 then this can be done with MCG to make a new modifier. Quite honestly the best place to ask for it would be on the Facebook group page and someone will respond!

                  https://www.facebook.com/groups/1611...41897/?fref=ts
                  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


                  • #10
                    It's much quicker if you create an array with all the vertex offsets and pass the to the polyop.moveVert.
                    Code:
                    --clearListener()
                    try destroyDialog roll_vertexRandomizer;catch()
                    rollout roll_vertexRandomizer "Vertex Randomizer"
                    (
                    	spinner spnX "X dinstance" range:[0,10000,1]
                    	spinner spnY "Y dinstance" range:[0,10000,1]
                    	spinner spnZ "Z dinstance" range:[0,10000,1]
                    	button btnRandomize "Randomize" width:roll_vertexRandomizer.width
                    	 
                    	on btnRandomize pressed do
                    	(
                    		local st = timeStamp()
                    		objs = selection as array
                    		clearSelection()
                    		for obj in objs do
                    		(
                    			if classOf obj == Editable_Poly do
                    			(
                    				local offSetArr = #()
                    				local verts = polyop.getNumVerts obj
                    				for i = 1 to verts do
                    				(
                    					offSetArr[i] = random ([-spnX.value, -spnY.value, -spnz.value]) ([spnX.value, spnY.value, spnz.value])
                    				)
                    				polyop.moveVert obj #all offSetArr
                    			)
                    			format "Time:% ms\n" (timeStamp()-st)
                    		)
                    	)
                    )
                    createDialog roll_vertexRandomizer style:#(#style_toolwindow,#style_sysmenu)
                    Offsetting 2 million vertices takes about 4 seconds on my pc.
                    Dan Brew

                    Comment


                    • #11
                      and does it use craploads of ram? it seemed that the examples i posted used arrays too.. however i cant actually read maxscript so i could be wrong..

                      if your script works (ill test it shortly) you are officially a lifesaver.

                      Comment


                      • #12
                        Originally posted by super gnu View Post
                        and does it use craploads of ram?
                        No it uses virtually no extra ram. I can't see any difference in the task manager while moving 4 million polys.

                        Originally posted by super gnu View Post
                        it seemed that the examples i posted used arrays too..
                        It does store the selected objects as an array. The slow down is caused by the number of times it modifies each mesh object (once for every vertex). If you store all the changes you want to make as an array and apply it once it's much quicker.
                        Dan Brew

                        Comment


                        • #13
                          yeee! cant wait to try it out.

                          Comment


                          • #14
                            that works perfectly..!! nearly instant and uses no ram at all.


                            thank you x100000000000000


                            i did find it hard to believe that jittering a load of vertices could be so difficult to do!
                            hopefully this will fix my doubleface shimmer..

                            Comment


                            • #15
                              Great, I hope it works for you.
                              Dan Brew

                              Comment

                              Working...
                              X