Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Pages: [1] 2

Author Topic: UVTools Preview  (Read 8566 times)

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
UVTools Preview
« on: February 12, 2014, 02:44:35 pm »

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 underlay
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 (Download - 198MB)


Changelog
v1.0 - 02/12/2014
  • Initial Release
v1.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
« Last Edit: May 19, 2015, 09:17:08 pm by Raxx »
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 298
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.
Re: UVTools Preview
« Reply #1 on: February 12, 2014, 02:50:57 pm »

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

captaindrewi

  • Sr. Member
  • ****
  • Posts: 450
  • errm...errr?
    • View Profile
Re: UVTools Preview
« Reply #2 on: February 12, 2014, 05:45:54 pm »

 :) errm gave it an idiot test.... :o
Logged
!

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
Re: UVTools Preview
« Reply #3 on: February 12, 2014, 08: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 :)
Logged

kreator

  • Hero Member
  • *****
  • Posts: 1098
  • Anim8or, Blender, & Carrara. A Great Combination!
    • View Profile
    • Anim8orWorld
Re: UVTools Preview
« Reply #4 on: February 12, 2014, 09: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

Logged
O

captaindrewi

  • Sr. Member
  • ****
  • Posts: 450
  • errm...errr?
    • View Profile
Re: UVTools Preview
« Reply #5 on: February 12, 2014, 11: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. :)

Logged
!

captaindrewi

  • Sr. Member
  • ****
  • Posts: 450
  • errm...errr?
    • View Profile
Re: UVTools Preview
« Reply #6 on: February 13, 2014, 02:01:15 am »

had a few more tries. :)
but not getting clear results like you.
latest attempt.
Logged
!

captaindrewi

  • Sr. Member
  • ****
  • Posts: 450
  • errm...errr?
    • View Profile
Re: UVTools Preview
« Reply #7 on: February 13, 2014, 02:18:31 am »

and another,just using basic low poly objects to test.
have included files incase they may be of help.
Logged
!

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
Re: UVTools Preview
« Reply #8 on: February 13, 2014, 08: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.
Logged

captaindrewi

  • Sr. Member
  • ****
  • Posts: 450
  • errm...errr?
    • View Profile
Re: UVTools Preview
« Reply #9 on: February 13, 2014, 12:36:43 pm »

OK,potentially it all looks marvellous. :)
Logged
!

kreator

  • Hero Member
  • *****
  • Posts: 1098
  • Anim8or, Blender, & Carrara. A Great Combination!
    • View Profile
    • Anim8orWorld
Re: UVTools Preview
« Reply #10 on: February 13, 2014, 08: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




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




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.
Logged
O

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
Re: UVTools Preview
« Reply #11 on: February 14, 2014, 10: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:
  • Create Canvas - Create a canvas for uv editing
  • Paint UVs Onto Canvas - Paint a selected shape, faces, or all shapes onto the canvas, allowing you to manipulate the UVs in point-edit mode
  • Apply UV Changes To Mesh - Applies the changes you made back onto the mesh(es)
  • Export SVG - Updated, UV Clusters are grouped now, added attribute options, better styling, progress bar added to console
  • Export PPM - Updated with a progress bar in console
  • View Pixelated UV View- Updated with a progress bar in console

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.
Logged

CrashDrive

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: UVTools Preview
« Reply #12 on: February 18, 2014, 12:25:23 am »

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.
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
Re: UVTools Preview
« Reply #13 on: February 19, 2014, 03:48:23 am »

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 ;)
Logged

CrashDrive

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: UVTools Preview
« Reply #14 on: February 19, 2014, 11: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. 
Logged
Pages: [1] 2