General Category > ASL Scripts

UVTools Preview

(1/5) > >>

Raxx:
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.


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.


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.


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

* (float - Default 0.5) SVG_InnerLineWidth : Width of the lines within a UV cluster
* (float - Default 0.5) SVG_InnerLineOpacity : Opacity of the lines within a UV cluster
* (float - Default 1.0) SVG_SeamLineWidth : Width of the seams of a UV cluster
* (float - Default 1.0) SVG_SeamLineOpacity : Opacity of the seams of a UV cluster
* (float - Default 0.3) SVG_MaterialOpacity : Opacity of each face, colored as its material diffuse color
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:

* Create a UV Canvas - This is the parametric shape that has the button "UV Canvas", white on black. Only one canvas can be used at a time, so keep only one in the workspace.
* (Optional) Assign a material to the canvas - If you want to edit the UVs on top of a texture, apply the material with its corresponding texture to the UV Canvas you had just created.
* Select the meshes or faces that you want to edit - Only mesh shapes (Build->Convert to Mesh) can be edited by scripts, so only mesh shapes are detected by these editing tools. Select a mesh, or select faces within one or more meshes, that you want to "paint" onto the UV Canvas you made.
* Go to Scripts->Paint UVs Onto Canvas - This "paints" the UV coordinates onto the canvas. In otherwords, it displays the UVs as if it were an image. The resulting mesh is called the "Context".
* Edit the UVs - In point-edit mode you can select the faces, edges, and points of the painted UVs and move or scale them. Note: Do not use point operations such as knife, bevel, merge, etc., on these painted UVs. You'll mess things up. Seriously.
* Go to Scripts->Apply UV Changes To Mesh - This applies whatever changes you made on the canvas back onto the mesh.

UV Editing
Some notes:

* It's best if you don't rotate the Canvas or Context, and just work with it from the front view. You can split the views if you want to zoom at an angle on the origin mesh while working.
* Again, don't perform mesh editing operations on the Context aside from move and scale. More UV editing tools like make seams, relax, merge, pack, etc., may come in the future, which is about all you could need. Also leave the origin mesh alone until you're done with the Canvas and Context
* You can undo UV edits by hitting undo until you get rid of the unwanted point operations done on the Context. Then go to Scripts->Apply UV Changes To Mesh.
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:

* UV Editing - Ability to edit the UVs of a mesh directly within Anim8or (in the same manner as programs like UVMapper
* Better UV viewing - Texture underlay, easier method of selecting a mesh for viewing
* Richer Export Options - More SVG styling options, UV clusters, padding, material-based export, texture underlayIf 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 (Download - 198MB)

Changelog
v1.0 - 02/12/2014

* Initial Releasev1.1 - 02/14/2014

* Added UV editing tools - Paint UVs, Apply UVs, Create Canvas
* Improved SVG Export
* Added progress bar to Export Scripts and View Pixelated

lppena:
Most excellent Raxx. Let me the first to say thank you. This is indeed a very cool set of UV mapping tools. Leroy.

captaindrewi:
 :) errm gave it an idiot test.... :o

Raxx:
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 :)

kreator:
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

Navigation

[0] Message Index

[#] Next page

Go to full version