Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Getting UVW transform from one face to apply to others

Getting UVW transform from one face to apply to others

lightcube
Advisor Advisor
343 Views
0 Replies
Message 1 of 1

Getting UVW transform from one face to apply to others

lightcube
Advisor
Advisor

I'm trying to figure out the best solution for guessing a good UV for a polygon resulting from a Cap Holes Modifier (or Epoly cap holes). At the moment, I'm just applying a UVWMap() to the resulting face. But this never automatically matches any of the surrounding UVs.

 

Ideally, the Cap Holes function would flow the UVs from the adjacent side of the first edge across the resulting polygon--and would apply across the whole polygon. But Cap Holes sadly only adds a guessed UV to the first tri of the Polygon.

 

I've done all the searches I can think of on Google for this, but almost always come back to similar questions I've made about related UVW topics.

 

Does anyone have a working solution in MAXScript to take any arbitrary polygon and get the transform of the polygon in UVW so that it can be re-used in another arbitrary face (via the a UVWMap gizmo transform or the polyop.applyUVWMap() method.)

 

In other words, I'd like to be able to do something like this:

 

Code:

 

uvtransform = getUVWTransformOfPolygon poly channelId sourcePolygonID

 

polyop.applyUVWMap poly #planar targetFaceId tm:uvtransform channel:channelId

 

Ideally, there would be a helper function as well to calculate the target uvtransform as it would be offset in world space between the source polygon and target.

 

In the following image, there are two object adjacent to one another. How would I get the appropriate UV from the Red Polygons and get them to apply to the Polygons represented with blue and black?

 



Shawn Olson

Developer of Wall Worm
3ds Max plugins and Scripts

3ds Max 4/Gmax - 3ds Max 2020
Mudbox 2009-2019

Windows 10 x64
i7 8700K
64GB RAM
Geforce 1080ti
0 Likes
344 Views
0 Replies
Replies (0)