Community
3ds Max Forum
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UV Unwrapping and Automatic UV Flatten on multiple objects but separate UVs

21 REPLIES 21
SOLVED
Reply
Message 1 of 22
Anonymous
27800 Views, 21 Replies

UV Unwrapping and Automatic UV Flatten on multiple objects but separate UVs

Hi There,

Our problem is that we have a very complex fbx made up from various objects and we want to unwrap and flattern each object and for each object to have its own UV map.

As it stands if we select all the objects and apply a UVW unwrap modifier to them they all share the same UV map, and when we flattern it spreads the unwrapped objects over a giant UV Map.

Is there a way we can unwrap each object and flattern each object without having to manually go through and click on each object one at a time... there are hundreds!

Thanks, Caius.
21 REPLIES 21
Message 2 of 22
albertoalvarez86
in reply to: Anonymous

Maybe if you attach all objects and make the UV with unwrapUV, then you put a edit poly and detach all objects, the unwrap survive to this process. I don´t Know if you ok with that.
Message 3 of 22
blakestone
in reply to: Anonymous

From what I can see the Automatic Flattern is a small script which simply:
- adds the Unwrap UVW modifier to the stack
- renames it to "Automatic Flattern UVs"
- runs the built-in Flatten Mapping with default settings

I have written a script which does all of this on the selected objects.
If you look in the script I have added user input settings so you can overwrite the default Flatten Mapping with your own parameters.

Hope this helps!

automaticflattern_v10.zip

--------------------------------------------------------------------------------------
Technical 3D Graphic Artist
Autodesk 3dsMax 2015 - Service Pack 4
--------------------------------------------------------------------------------------
Message 4 of 22
ramissin
in reply to: blakestone

Cool script, your vertex placer is sweet too.

thx
Message 5 of 22
blakestone
in reply to: Anonymous

Thanks man... I have been writing MaxScripts non-stop at work of-late and looking for opportunities like this to practise, also help out a fellow modeller at the same time 😛
--------------------------------------------------------------------------------------
Technical 3D Graphic Artist
Autodesk 3dsMax 2015 - Service Pack 4
--------------------------------------------------------------------------------------
Message 6 of 22
blakestone
in reply to: Anonymous

I have added the ability to specify a Map Channel when executing, also slightly adjusted the code to make it more stable. Please let me know if you have any troubles running it.

automaticflattern_v11.zip

--------------------------------------------------------------------------------------
Technical 3D Graphic Artist
Autodesk 3dsMax 2015 - Service Pack 4
--------------------------------------------------------------------------------------
Message 7 of 22
ramissin
in reply to: blakestone

Thx again, I just noticed your post on the first page, (this damn forum stopped alerting me to post updates as usual).
Very useful when all I want/need is quick mapping, and no need to fiddle about in the UI. Great time saver and helps avoid repetitive mouse clicks 😉
Message 8 of 22
shah.kurosh
in reply to: blakestone

Hello, I'm using this Script.

It works great! And helped me a lot.

But the problem is sometimes it dosen't work correctly.

i have to go to Modifiers tab and select the 'automatic uvw" and select all the faces and then click the fletten button.

is there any way to make this script do this in the way that i dot need to go through all these steps Because i work with unreal engine and there is lots of lots of Objects.. Smiley Sad

Thanks and sorry for my bad english.

Message 9 of 22
blakestone
in reply to: shah.kurosh

Hi "shah.kurosh"... I have rewritten the the script to be a little more stable (see attachment).
Give it a try and let me know how it goes!

--------------------------------------------------------------------------------------
Technical 3D Graphic Artist
Autodesk 3dsMax 2015 - Service Pack 4
--------------------------------------------------------------------------------------
Message 10 of 22
shah.kurosh
in reply to: blakestone

So So Sorry for answering late.

thank you for your time.

Same probl Smiley Sad

let me demonstrate:

This is a 3d model of a wall:

 

01.jpg

 

This is the result of Script:

 

02.jpg

 

This is result of using Mapping / Flatten Mapping/ Ok..  and what we are looking for:

 

03.jpg

 

thank you so much for your time and help.

I'm really behind my schedule and I'm really nervous about it..

Message 11 of 22
shah.kurosh
in reply to: blakestone

isn't there any way to make these steps automatically happen?
1_add a unwrap uvw modifier
2_Go To polygon mode
3_Select all the faces
4_Open UV Editor(optional..) (You know what? Never mind..)
5_Mapping>Flatten Mapping>OK

It would be very nice to have an option for selecting channel.
i wish i knew max scripts.
looks so cool.. but isn't easy..
Message 12 of 22
lightcube
in reply to: shah.kurosh

Honestly, if you have to do this thing a lot, your best solution is to buy Flatiron.



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
Message 13 of 22
blakestone
in reply to: Anonymous

Hi shah.kurosh,

 

You have identified an issue with this script which I have corrected in the attachment v1.3.

What the script is doing...
The script is taking all the Geometry Objects in your current selection and one-by-one doing the following:

- Adding the "Unwrap UVW" modifier but is renaming it to "Automatica Flatten UVs" to the top of your Modifier Stack
- Selecting the Top-Most modifier in the Modifier Stack (which is the new modifier)
- Sets the UV Channel on this modifier
- Performs the built-in "Automatic Flattern" on this modifier

The issue with v1.2 was that the script was looking for the modifier called "Unwrap UVW" before it renamed it to "Automatic Flartten UVs" which if you had already had one in your Modifier Stack would be at risk of having this one selected instead of the one the script had just added.

Give this a try and see how you go, sorry for the inconvenience.



--------------------------------------------------------------------------------------
Technical 3D Graphic Artist
Autodesk 3dsMax 2015 - Service Pack 4
--------------------------------------------------------------------------------------
Message 14 of 22
shah.kurosh
in reply to: lightcube

Good But expensive..
not much benefit in my current project to spend!
Message 15 of 22
shah.kurosh
in reply to: blakestone

hi.

thanks for the help.

it works great  in most models but it gives me an error in my scene.

maybe the problem is in my model.

here is the listener:

 

-- Error occurred in button_uv.pressed(); filename: C:\Users\Kurosh\AppData\Local\Temp\Rar$DRa0.885\AutomaticFlattern_v13.ms; position: 4162; line: 101
-- Frame:
-- modifier_array: undefined
-- obj_selection: #($Pellei_Down_R)
-- uv_value: 3
-- uv_modifier: Uvwmap:UVW Map
>> MAXScript Rollout Handler Exception:
-- Unknown property: "unwrap" in Uvwmap:UVW Map <<

 

and here is an screenshot:

0.jpg

Message 16 of 22
blakestone
in reply to: Anonymous

Basically the script couldn't add the "Unwrap UVW" modifier to one of your models "Pellei_Down_R" and when it tried to access this missing modifier to perform the Automatic Flattern it failed.

What type of model is "Pellei_Down_R" is this an Editable Mesh, Editable Poly or something different?

--------------------------------------------------------------------------------------
Technical 3D Graphic Artist
Autodesk 3dsMax 2015 - Service Pack 4
--------------------------------------------------------------------------------------
Message 17 of 22
lightcube
in reply to: shah.kurosh


@shah.kurosh wrote:
Good But expensive..
not much benefit in my current project to spend!

Yeah, so it's good that we have people like @blakestone and many others sharing free scripts and tools. It's part of the beauty of the Max world.

 

That being said, I once wrote a script that is similar to Blake's and still use another related script on occassion for merging maps in multiple objects after using RTT on them when they share UV space.

 

But the problem with my old script (and likely Blake's ) is that it's in MAXScript... and many functions in MAXScript are notoriously slow and have to intereact with the Max UI... which can make things even slower.

 

If this is a one-off project, using a script probably makes sense. But that's why I said if you do this a lot you should get Flatiron. I was eyeing it a year or two before I finally got it... and afterwards wished I'd gotten it sooner. It is a life-saver in cutting out time for this kind of project.



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
Message 18 of 22
shah.kurosh
in reply to: blakestone

it's Editable Poly.
and its converted.
i haven't modeled it.basically modelers made line>extrude>many copies>Group.
and when they finally gave it to me i used Collapse to merge them all and converted it to editable poly.

for the most parts i had to remodel many objects!

with that being said, i had problems with AutomaticFlattern_v12 on standard models too.

can't remember to demonstrate right now but i would be happy to help debugging and upgrading your script.

this helped me a lot.

thank you.

 

Message 19 of 22
shah.kurosh
in reply to: lightcube

of course.
and much appreciation to him.
and you are right about that being time consuming.but like i said this is too expensive for this project.and i wand to invest most of my money from this project on hardware.
god willing i want to buy this in my next project.
Message 20 of 22
snake85027
in reply to: blakestone

I have a question.  Im running your script right now. Is there a way to add UV scaling option so that all of the objects will be the same uv scale size? Theres a button in max uv editor that you can grab the faces and make sure the uvs are all even with each other. I want to do that for the separate objects but they all are uniformly scalled with eachother even though they are separate objects. Is that possible?

 

The reasoning is that I have a bunch of objects that I want to share the same material. Since they are different sizes when I apply that 1 material on them they would be scaled differently. I would have to manually go in and scale each objects uv to match each other.

 

well i wonder if there is a way to have each model their own GROUP, attach all, unwrap flatten,arrange scale to be same, then detach based on groups. Anyway just a thought.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report