Anim8or Community

General Category => ASL Scripts => Topic started by: Raxx on February 12, 2014, 09:44:35 am

Title: UVTools Preview
Post by: Raxx on February 12, 2014, 09:44:35 am
UVTools Preview

Introduction
Welcome to another set of specialized scripts by yours truly. Ever want to export the UVmap of a model straight from Anim8or? Or better yet, view it directly within the Anim8or workspace?

Well, UVTools is a set of tools made to do just that!

What You Get
Create Canvas ("UVCanvas" parametric shape)
This shape creates a blank canvas, which is required if you want to use the next two tools.

Paint UVs Onto Canvas
This script paints the selected shape or faces onto the canvas. If nothing is selected, all shapes in the object will be painted. If there is no canvas, nothing happens. Only MESH shapes can have their UVs edited by these tools. Convert any other shape to mesh (including subdivision meshes) if you want to edit their UVs.

Apply UV Changes To Mesh
This script applies the UV coordinates represented on the Canvas back onto the mesh. If no canvas and/or no "context" exists, nothing happens.

View Vector
Creates a general UV canvas in the workspace, in the form of a parametric shape. Has options such as Width/Height (the ratio) and Shading (the darkness of the mesh overlay). You must mark a mesh in order to view its UVs on the canvas. This shape is not the same as "Create Canvas", and is only for viewing UVs. Basically, it's redundant and will probably be removed.

View Pixelated
More novelty than anything else. Creates a pixel-based canvas in the workspace, in the form of a parametric shape. Has options such as width, height, scale, and line transparency. You must mark a mesh in order to view its UVs on the canvas. Please note that Anim8or is really slow with generating meshes from ASL, so avoid using this on high-def meshes, and beware setting high width and height values.

(http://an8.the-meadow.net/Com/UVTools/UVview.png)
View Vector on Left, View Pixelated on Right (as seen in the workspace)

Mark Shape
Mark which mesh(es) you want to view for the view-type scripts above. Do this by selecting the mesh(es) and going to Scripts->Mark Shape. Note that if you have nothing marked, nothing will appear on the UV canvas except a blank square.

Export PPM
Export your UVs to the .ppm format, which is compatible with image editors such as Gimp and Photoshop. To use this, select the meshes you want to export, or select none to export all of them. Optionally, create the "PPM_Width" and "PPM_Height" integer attributes to customize the export resolution. Exports as black lines on white background.

(http://imageshack.com/a/img546/38/t4sr.png)
Example of an Exported PPM

Export SVG
Export your UVs to the popular Scalable Vector Graphics format, which is compatible with software such as Inkscape, Gimp, and Illustrator, as well as all modern web browsers. To use this, select the meshes you want to export, or select the faces you want to export, or select none to export all of them. If you select faces, and then select a mesh, it'll only export the selected faces of that mesh.

(http://imageshack.com/a/img835/4666/czhz.png)
Example of an Exported SVG

Comes with these export options, in the form of object attributes you have to create:

If you view the exported SVG file in a modern web browser, you'll notice mouse hover effects. I'm investigating some form of interactive capability if viewed in a web browser, such as detailed information and manipulation.

How To Edit The UVs
The v1.1 release added the ability to edit the UVs of a mesh shape directly within the workspace. Here's a quick run-down of how to do so:

(http://imageshack.com/a/img268/4990/iyyh.png)
UV Editing

Some notes:

Your Feedback
These scripts are basic in concept and practice. However, I feel that they have potential. Pending whether you guys think it's worth pursuing, I'll add more features to these tools, to include:
If you want to give it a shot, download the attachment and install all the scripts into your Scripts directory that Anim8or autoloads from. If you have feature requests, bug reports, complaints, or ideas, post them here.

Demonstration Video

Changelog
v1.0 - 02/12/2014
v1.1 - 02/14/2014
Title: Re: UVTools Preview
Post by: lppena on February 12, 2014, 09:50:57 am
Most excellent Raxx. Let me the first to say thank you. This is indeed a very cool set of UV mapping tools. Leroy.
Title: Re: UVTools Preview
Post by: captaindrewi on February 12, 2014, 12:45:54 pm
 :) errm gave it an idiot test.... :o
Title: Re: UVTools Preview
Post by: Raxx on February 12, 2014, 03:27:26 pm
captaindrewi, so what is the problem, exactly? Care to share the file as well? I did notice the UVview_vector mesh is a little detached from the canvas on the Z-axis so that if you look at it from a side angle it looks a little odd, and will have that fixed in the next update. However my tests have all been consistent in terms of accuracy.

And thanks Ippena :)
Title: Re: UVTools Preview
Post by: kreator on February 12, 2014, 04:26:35 pm
I assume that it must be very low poly to have any effect? Might be useful to see progress in the console window, but good start  Raxx with  something that is badly needed.  ;D

Title: Re: UVTools Preview
Post by: captaindrewi on February 12, 2014, 06:44:28 pm
I dont know if there is a problem raxx
by idiot test ...i mean i'm an idiot and what you see is what this idiot produced trying to use it.
not sure how you get everything nicely organised front, back, sides etc.
i only had a quick go to see it in action and i could follow your instructions.
so dont think there is a problem beyond my ineptitude atm. :)

Title: Re: UVTools Preview
Post by: captaindrewi on February 12, 2014, 09:01:15 pm
had a few more tries. :)
but not getting clear results like you.
latest attempt.
Title: Re: UVTools Preview
Post by: captaindrewi on February 12, 2014, 09:18:31 pm
and another,just using basic low poly objects to test.
have included files incase they may be of help.
Title: Re: UVTools Preview
Post by: Raxx on February 13, 2014, 03:27:38 am
Thanks for the feedback! I'll keep workin' on it and will post an update when I've finished the UV editing script.

captaindrewi, looks like it's working as it should. The UVs displayed in those images are correct, and the .an8 files work fine. They may not look as "clear" as the example in the first post, since I unwrap my models by hand.

Kreator, it's only slow with the UVview_pixel parametric shape, which I wouldn't recommend using except out of idle curiosity. Everything else, especially the UVview_vector shape, is pretty fast. The PPM file took a split second (attached as frogppm2.png).

The frog2.svg image took a 4-5 seconds, the other one less than a second. This is mostly because I just added UV Cluster detection to it and haven't optimized it yet. The current release is much faster without.
Title: Re: UVTools Preview
Post by: captaindrewi on February 13, 2014, 07:36:43 am
OK,potentially it all looks marvellous. :)
Title: Re: UVTools Preview
Post by: kreator on February 13, 2014, 03:07:04 pm
Ok, This does not work unless you have already UV`D your model in some form I tried my Lizard that I had UV`d with Roadkill

(http://anim8orworld.com/files/RK1.jpg)


If it is not UV`d It looks like this.....

(http://anim8orworld.com/files/Un_UVD.jpg)


To get an export of the resulting map you need to go to Menu/Object/Export... and use the PPM export in the dropdown.

Saves having to use UVmapper ... though not sure regards unwrapping, I would assume you still need to Unwrap it with an external program. Or could edges be selected so that they acted as the marked items to be exported.
Title: Re: UVTools Preview
Post by: Raxx on February 14, 2014, 05:28:46 am
Yes, it still needs to be unwrapped, either through Anim8or's tools or through external tools, or potentially through UVTools. Faces that have no UV data get coordinates of (0,0), meaning all of its UV vertices are in the bottom left corner of the texture.

Update v1.1 is released! I've done a lot for it, to include:

You'll find the update and more info in the first post. Due to file name changes, please be sure to delete all of the old scripts before adding the new ones.
Title: Re: UVTools Preview
Post by: CrashDrive on February 17, 2014, 07:25:23 pm
So I spent my Sunday making a new low poly game character to try out these UV tools.

I find parametric shapes always tend to get in the way. This is partly to blame because of
Anim8or's unfriendly fixed window system. However, the two window setup seemed to work
the best so I could freely rotate my model without disturbing the UV canvas.
Having only one parametric canvas to work with would save confusion.
At the moment, what can be done is of course limited, but was useful in correcting this model
within the program. Making adjustments to the UV coordinates would also be easier if they
were updated in real time on the model.

Not sure how far you can take this using 'asl scripts' but even a basic unwrapper would
be a good addition to the built in UV tool.

I credit Raxx for the hours spent, once again trying to increase Anim8ors capabilities.
Title: Re: UVTools Preview
Post by: Raxx on February 18, 2014, 10:48:23 pm
CrashDrive, glad to see you put it to practical use :) I like your game character as well!

The way I think it would be best to treat UVTools is as a single job separate from the rest. That is, when it's time to unwrap the mesh, you create the UV canvas, unwrap the mesh with the tools, and then delete the UV canvas, then forget about it until the next unwrapping occasion. The reason that the canvas is a parametric shape is because I wanted to automatically make sure the user doesn't accidentally select and manipulate the points of the canvas square.

I admit, this toolset isn't anywhere near a proper unwrapping alternative yet. Currently it's just a UV viewer and editor. That advanced stuff like LSCM, pins, seams, etc, are best done with data structures and programming tools that aren't yet available via ASL. I might be able to implement some seam-based unwrapping features, but everything else will have to wait until ASL gets some updates.

I've already started on the next project. Yes, it's another script that pushes the limits of ASL, but might be marginally more useful from the start ;)
Title: Re: UVTools Preview
Post by: CrashDrive on February 19, 2014, 06:09:56 pm
Raxx, I think it would be great if you could find a way of marking seams and unwrapping on
top of what you've done so far. Even if it's just an angle based unwrap only, I think it would really
benefit the new users to 3d modelling as well as a helpful tool for more experienced users.

Like many of us here, Anim8or was the first program to make 3d modelling possible.
Maybe someday your work will help add an 'Unwrap Mode' to the main menu.

Looking forward to seeing what else you're working on and likewise on your Doberman model. 
Title: Re: UVTools Preview
Post by: Steve on March 05, 2014, 06:24:51 pm
Raxx, this is really cool. UV tools like this are on my long list of things to do but I don't know when I'll get to them. Nice work.
Title: Re: UVTools Preview
Post by: Raxx on May 18, 2015, 04:12:25 pm
I added a demonstration video. Kind of just winged it so it's a little awful, but might help people figure out how to use it.

I didn't go over how to use attributes for the various export options. Refer to the first post for specifics in that regard.
Title: Re: UVTools Preview
Post by: neirao on May 18, 2015, 09:37:44 pm
Very Thanks Raxx
the video is very helpfull!! :)
Title: Re: UVTools Preview
Post by: johnar on May 19, 2015, 07:31:20 am
sorry raxx
 I cant find/see the demonstration vid?.....(http://s13.postimg.org/668ay1knn/blush1gry.gif)
 Love the idea of the tool tho....

oops. posted too quick.  found it!.... Double blush .(http://s13.postimg.org/668ay1knn/blush1gry.gif)(http://s13.postimg.org/668ay1knn/blush1gry.gif)(http://s6.postimg.org/zd57j8ja5/gryrolleyes.gif)

 EDit: raxx Its amazing to hear your voice!!!  (http://s23.postimg.org/zaoogxv9j/BGwavegry.gif) Somehow i feel like i know you so much better now. (http://s8.postimg.org/j64xwcx9d/Big_Grin_Gry.gif)

 Can't work out how to download the demonstration vid. Could you please zip-er-up and make it downloadable..? (http://s24.postimg.org/cn9xhqr5t/SSG03_G.gif)
Title: Re: UVTools Preview
Post by: Raxx on May 19, 2015, 05:26:02 pm
No problem, neirao :)

Johnar, I'm glad my muddy voice lent me more personality ;)

I uploaded the video, the link (http://an8.the-meadow.net/Com/UVTools/UVTools_demo_video.zip)'s posted above the demo video in first page.
Title: Re: UVTools Preview
Post by: Hypure on November 13, 2015, 06:17:13 pm
This is so much easier then UV mapper!  I really appreciate this...... I just realized I uploaded a modal that I already had unwrapped,  I was thinking wow this is amazing...  BUT still, this is great - I'm a lazy modeler and this will definitely improve my workflow!
Title: Re: UVTools Preview
Post by: Unobtainium on March 20, 2017, 11:20:06 am
Raxx, I think it would be great if you could find a way of marking seams and unwrapping on
top of what you've done so far. Even if it's just an angle based unwrap only, I think it would really
benefit the new users to 3d modelling as well as a helpful tool for more experienced users.

Like many of us here, Anim8or was the first program to make 3d modelling possible.
Maybe someday your work will help add an 'Unwrap Mode' to the main menu.

Looking forward to seeing what else you're working on and likewise on your Doberman model. 

What kind of datastructures, would it be possible to implement them in ASL? (I haven't taken a close look at ASL yet but have made at least basic datastructures before)
Title: Re: UVTools Preview
Post by: daren_Anim8or on December 29, 2021, 09:18:52 am
Dear Raxx,

             Can't seem to downlaod your UVTools demo video.zip. Is there anywhere else it may be available? Belatyed MErry Xmas and pre-emptory New Year.

Thanks
daren_anim8or
Title: Re: UVTools Preview
Post by: Raxx on January 02, 2022, 06:31:12 am
@daren_Anim8or apologies but the video download is no longer available. I did update the first post so that the Youtube embed works properly. You can view the video there.