Simple script that randomizes vertex positions.

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
 (
 with undo on
 (
 objs = selection as array
 for obj in objs do
 (
 if classOf obj == Editable_Poly do
 (
 verts = polyop.getNumVerts obj
 for i = 1 to verts do
 (
 polyop.moveVert obj i \
    [(random -spnX.value spnX.value),\
    (random -spnY.value spnY.value),\
    (random -spnZ.value spnZ.value)]
 )
 )
 )
 )
 )
)
createDialog roll_vertexRandomizer style:#(#style_toolwindow,#style_sysmenu)

3 Comments

robin · February 27, 2016 at 9:46 pm

This script looks like just what i want.. however its impossible to use on heavy meshes. i tried it on a 1.6 million poly mesh and it maxes out 72GB (!!) of ram and locks up my workstation.

    robin · February 28, 2016 at 12:15 am

    hell it maxes out 72GB on a 200k poly mesh too.

Stefan · October 17, 2013 at 1:19 pm

Very cool script, close to waht i was looking for. Can you tell me, what i would neet to alter, so it would just have an effect on the vertices I selected. I am pretty new to scripting so please excuse this rather basic question. thanx in advance

Leave a Reply to Stefan Cancel reply

Your email address will not be published. Required fields are marked *