Forum Groups
  All forums
    Help & Feedback
      Questions
      Work in progress
      Finished Art
      Non-Max related
    Community
      Offtopic
      News
    Hardware
    Photography


Featured Threads
  inspiration alert!!!
(36 replies)
  Indespensible MaxScripts, Plugins and 3rd Party Tools
(37 replies)
  The allmighty FREE Resources Thread !
(17 replies)
  spam alert!!!
(4886 replies)
  Maxforums member photo gallery index
(114 replies)
  Maxforums Member Tutorials
(89 replies)
  three cheers to maxforums...
(240 replies)
  101 Things you didnt know in Max...
(198 replies)
  A Face tutorial from MDB101 :D
(95 replies)
  Maxforums.org Members Gallery
(516 replies)
  SON OF POST YOURSELF
(637 replies)
  Dub's Maxscript Tutorial Index
(119 replies)

Maxunderground news unavailable

Looking for a little automation help
show user profile  jpedleham
I have lots and lots of jpegs all named like this (x is in place of a number)

xxxxxx_AMACxxxxxxx_LengthxWidth_xxxxxx_xx.jpg

Ive got my script working but id like to build in some error checking


posdirectory = getSavePath caption:"Select POS Folder"
for f in (getFiles (posdirectory+"\\*.jpg")) do
(

CURRENTFILENAME = filenamefrompath f
myarray = FilterString currentfilename "_Xx"
poslength = myarray[3] as integer
poswidth = myarray[4] as integer
currentpos = box length:poslength width:poswidth height:3 isSelected:on
newmat = StandardMaterial()
newmat.name = ("MAT_" + currentfilename as string)
myBmp = bitmaptexture filename: f
newmat.diffusemap = mybmp
$.material = newmat
modPanel.addModToSelection (Uvwmap ())
collapsestack($)
$.name = getFilenameFile f
deselect($)
)

Sometimes, there may be files in the folder that dont fit the correct filename structure. Id like to skip those if possible and just move onto the next file.
usually itll throw an error because the length value is undefined.
Also is there a way of automatically flipping the UV on the rear face of the box im creating so the jpeg displays correctly on both sides??

Thanks
Jack
read 437 times
4/21/2016 9:54:03 AM (last edit: 4/21/2016 11:01:55 AM)
show user profile  jpedleham
I figured out everything other than the UV flip which im happy to do manually unless its a simple snippet
read 422 times
4/21/2016 11:20:25 AM (last edit: 4/21/2016 11:21:04 AM)
show user profile  herfst1
UVW Xform is the way to go to flip uvs.
read 404 times
4/21/2016 1:55:19 PM (last edit: 4/21/2016 1:55:19 PM)
show user profile  jpedleham
Thats a brilliant idea actually. Is there a way you can pause the script and wait for the user to select a face in the edit poly modifier??

$.EditablePoly.SetSelection #Face #{1}
$.faceExtrudeHeight = 10
subobjectLevel = 0
modPanel.addModToSelection (Face_Extrude ()) ui:on
$.modifiers[#Face_Extrude].amount = 3
modPanel.addModToSelection (Cap_Holes ()) ui:on
actionMan.executeAction 0 "310"
modPanel.addModToSelection (Edit_Poly ()) ui:on
subobjectLevel = 4
$.modifiers.[#Edit_Poly].SetSelection #Face #{}
$.modifiers.[#Edit_Poly].Select #Face #{31} --here is where i want to wait for user input
modPanel.addModToSelection (UVW_Xform ()) ui:on
$.modifiers[#UVW_Xform].U_Flip = 1

read 380 times
4/22/2016 10:17:56 AM (last edit: 4/22/2016 10:19:54 AM)
show user profile  jpedleham
I Ended up using a small script from scriptspot that selected the top face of an object and adjusting it to select the bottom face instead removing the need for user interaction with this part of the process.
read 360 times
4/22/2016 4:00:38 PM (last edit: 4/22/2016 4:00:38 PM)
#Maxforums IRC
Open chat window


Support Maxforums.org