[Closed] Scene Redraw
Hi, I’m having some trouble with the scene redraw commands.
I am using a script that runs a loop on the number of faces in the selection, therefore if I’ve got an object with 2000 faces selected it can take several minutes to run. I’ve read about the “disable / enable scene redraw” commands and the “with redraw off” but have little luck having any to work, or atleas have an effect on the speed of the script.
can anybody give me an overview of these or what to do?
the script is below:
Also many thanks for any help.
selFace = $.EditablePoly.GetSelection #Face
selFace
mapSizeL = 2200
mapSizeW = 600
range =500–face = 1
for face in selFace do
(
$.EditablePoly.SetSelection #Face #{face}
modPanel.addModToSelection (Uvwmap ()) ui:off
$.modifiers[#UVWMapping].maptype = 4
$.modifiers[#UVWMapping].length = mapSizeL
$.modifiers[#UVWMapping].width = mapSizeWrandPos() maxOps.CollapseNode $ off subobjectLevel = 4
)
haven’t got the chance to try it but maybe ‘with redraw off’ syntax should help you out.
with redraw off (
<your code here>
)
No luck with that. I’m sure it should work mind you. oddly in the mascript help file for “with redraw off” in the example the word “redraw” in the line “with redraw off” is bold blue, however in my script editor it is not. (it looks like this) “with redraw off” surely this means that “redraw” is not defined?
several minutes… what do you expect to get if you apply modifier, and collapse stack for every face?
do face mapping on the mesh level and it will take… let me guess… less then 0.1 sec.
Thanks for your rather blunt reply. I’ll definately look into what you’ve said though. I’m both new and bad at Maxscript, thanks for the pointer though. I’ll definately look into it.
Edit: I doub’t anybody could point me to a good starting place?
your question was about how to do things without scene redraw. i can answer you questions but does it help in your case?
redraw off context works for max view only. it doesn’t block UI (modifiers panel in your case) redraw. if you want to disable UI redraw you can find a solution (including mine) searching this forum.
Editable_Poly Mapping Methods is where you to go first. but meshop interface much faster then polyop. if you don’t need to keep your faces as polys do all map operations with editable_mesh.
second… you don’t need box mapping. it doesn’t make any sense for faces.
don’t do mapping per face. apply polyop.applyUVWMap for all selected faces (#planar) and randomize positions(rotation,scale) after that.
Excellent, thanks very much Denis for your time and also for the clear description. It’s much apreciated.
indeed my question was about scene redraw. I’ll have to search the forums with a more watchfull eye, I’m currently at work (I’m more a modeller than a scripter)
And I’m trying to map a flat plane, for use randomising the texture on floors or tiles so one large map can be used and little tiling can be seen.
Thanks so much for your time and help. It’s greatly apreciated.
i guessed that you are mapping something flat. so i was right – the #planar mapping should be used