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

Xforming a texture to sweep in maxscript
show user profile  3joez
I'm facing this task:

I have a lot of splines with different lenghts(with a sweep modifier on them and generate mapping on).

I have one texture for all of them.

I have to uvxform every piece in order to fit correctly the texture repetition.

Can you suggest a way to do it via script?

--------------

Practically and in other words, say the texture is 2048x256.

Say I need to repeat it horizontally in a segment which is 10 meters long and then adapt it so it has the same aspect on a segment which is 1 centimenter long.
Manually, I'd go with uvwxform modifier and in every " u tile" spinner, I'd be changing it's value.

Edit: The effect would exactly be the same of using real world map size (but of course I can't use it, for the sake of this specific task)
read 434 times
7/1/2014 3:30:37 PM (last edit: 7/1/2014 4:24:39 PM)
show user profile  Dub.
You can get the length of the spline with this:

splineLength = curveLength yourSpline curveIndex

Curve index is the index of the spline you are interested in - a single spline shape can have multiple "curves" in it - this index ensures you are getting the length of the right one.

yourSpline is obviously the splineshape object you are talking about.

With the length information, you can just calculate an appropriate tiling number and apply it to the tiling attributes of the spline UVs.

R


read 395 times
7/3/2014 4:25:54 AM (last edit: 7/3/2014 4:25:54 AM)
show user profile  3joez
Done. Thanks Dub!
read 386 times
7/3/2014 8:21:52 AM (last edit: 7/3/2014 8:21:52 AM)
#Maxforums IRC
Open chat window


Support Maxforums.org