PDA

View Full Version : Script: UV coordinates


Firebird
05-21-2003, 08:48 PM
I want to make a script that can move all the UV coordinates for an object together to a new position, but I canít find how to
move UVs at all. Any one how knows how to do this?

(I am a newbie at maxscript.)

Thx in advance.

Bobo
05-21-2003, 09:52 PM
Originally posted by Firebird
I want to make a script that can move all the UV coordinates for an object together to a new position, but I canít find how to
move UVs at all. Any one how knows how to do this?

(I am a newbie at maxscript.)

Thx in advance.

Could you explain in details what you want to do?
IMO, if you cannot explain step by step what the goal is,
chances are big you will be unable to script it...

Do you mean increasing the UV values by the same offset to get the coordinates shifted? In that case, you could just add an UVW_XForm modifier using MAXScript and set the offset values as desired.
Or you could collapse to EMesh, read, change and write back the UV values (much more difficult for a starter).
Or add a UVW_Undwrap and use the latest Interface methods added in Max 4 and 5 to do the same (even more difficult for a new user)

Any additional info would be helpful...

Firebird
05-21-2003, 11:23 PM
If I am for instance making a house and have lots of board for the outer walls. What I want to be able to do is to add UV coordinates to the first board duplicate it to make one of the sides of the house.
For the board texture I would use a big wood texture. The board only fills up a small part of this howl texture.

I want to be able to select all the boards that I have duplicated. And have a script moving the existing UV coordinates to a random position with in the UV space.

What I would need to know....

1. How to see UVs position.

2. How to select them.

3. How to move them.


With this info I should be able to make a script that stores every UVs position in an array, finds the biggest and smallest position in U and V direction, gives the UVs a new random position within the area that is left to the edges of the UV space. Then add the same random value to every UVs original position so that they will move "together".

I have some knowledge of maxscript. But if the principle that I have written works and the coding isnít to difficult/complicated I think that I can pull it of with a little push to get me started with the basics.

LFShade
05-21-2003, 11:45 PM
You'll probably find that the easiest way to do this is to add a planar UVW map to each plank, randomly offsetting each mapping gizmo on its local X and Y axes. Either that or use the UVW Xform modifier as suggested by Bobo. I'd give you some basic code to work from, but I have no access to Max or the Maxscript docs right now, and I'm not very good at ad-libbing code:)

RH

Firebird
05-23-2003, 03:24 PM
I have looked on the UVW Xform modifier and it should be able to do the trick. But can I still find the UVs with the biggest and smallest U and V position??

And how do I change the sinners in the UVW Xform modifier with a script?

CGTalk Moderation
01-15-2006, 05:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.