hey guys. first up, i dont take credit for that plugin. its by axel lee. i found this plugin rantexpos at http://rhin.crai.archi.fr/rld/plugin_details.php?id=324
it doesnt seem to work in su 8. can one of you look into it and maybe correct it? i'm not into coding but really need this to work.
its supposed to randomize the texture position of the selected group/faces.
code is as follows.
def rantexpos
Sketchup.active_model.start_operation("RANTEXPOS!")
selected = Sketchup.active_model.selection
for ent in selected
if( ent.is_a? Sketchup;;Face )
tex = ent.material
texpoint = []
texpoint.push [rand(2048), rand(2048), rand(2048)]
texpoint.push [rand(2048), rand(2048), rand(2048)]
texpoints = [texpoint[0],texpoint[1]]
ent.position_material (tex, texpoints, true)
ent.position_material (tex, texpoints, false)
end
if( ent.is_a? Sketchup;;Group )
for fac in ent.entities
if( fac.is_a? Sketchup;;Face )
tex = ent.material
texpoint = []
texpoint.push [rand(2048), rand(2048), rand(2048)]
texpoint.push [rand(2048), rand(2048), rand(2048)]
texpoints = [texpoint[0],texpoint[1]]
fac.position_material (tex, texpoints, true)
fac.position_material (tex, texpoints, false)
end
end
end
end
Sketchup.active_model.commit_operation
end
filename="rantexpos.rb"
if !file_loaded?(filename)
plugins_menu = UI.menu("Plugins")
if plugins_menu
plugins_menu.add_separator
plugins_menu.add_item("Randomize texture positions") {rantexpos}
end
file_loaded(filename)
end
thanks in advance.