PDA

View Full Version : First try at UV generator


Lynx3d
03-03-2003, 01:10 AM
Am currently writing something where you'd think it's already a standard Lightwave tool, but for some reason the !)($§/% Texture Guide in Lightwave goes nuts for me when i put the center somewhere off the origin and rotate the axis...

So this is nothing more than an attempt at a working UV mapper, currently only does cylindrical mapping, no comfort yet (you can only drag the center and one side to change the size), no discontinuous UVs either.

So if you want to beta...er no let's say alpha test, and are using a PC you can try it:
uvgen.p (you may have to tight click and "save target as") (http://www.bingo-ev.de/~mw1299/lw/uvgen.p)

May behave a bit strange, and for some reason my Modeler crashes on closing...?
Should work with 6.5+
Maybe anyone is interested in the source codes, but i am to lazy now to "clean" and upload 'em, so just ask for it.

jin choung
03-03-2003, 05:28 AM
a WORTHY PROJECT!!!

there is INDEED and MOTHERF#@#@%$ing bug for TEXTURE GUIDE when you drag substantially off of the origin!!!

ARGH!

well good luck and let us know if you get discontinuous mapping working....

jin

Valter
03-05-2003, 04:57 PM
Nice initiative. Lw need more people try make it better.


I don't take it yet. But I really need a better UV in LW.


btw thanks you

excuse my english.

Lynx3d
03-18-2003, 05:30 AM
Just spent the whole night with coding...without my dullness i might have made it in a fraction of the time :D

anyway, updated the file from the link above.
Still only cylindrical, however it now does distinguish between selection modes. In point and volume mode it only does create continous UVs (the one you can drag in a UV view), in polygon mode it accounts for the setting "Fix seam" that (tries to) fix the seam (oh really? :D) by adding discontinous UVs where necessary.

Still a lot of work...fix some strange behaviours, need to check for existing discontinous UVs, make a list of existing UV maps, make it store the data for texture layers, implement the other mapping types etc...

Maybe i get some feedback!

spikey
03-18-2003, 10:53 AM
So far very promising!

I do game graphics for living and tested this on some objects (~6k polys).. It did the seam quite nice!

Keep it up, this might prove to be a real time/nerve/greyhair/whatever-saver :)

Lynx3d
03-20-2003, 03:56 PM
Another small update:

viewport gizmo now shows where the top of the cylinderder is,
you get a list of existing UV-Maps and the active one (if available) is selected,
discontinous UVs are cleared before new UVs are created (for whatever reason this doesn't work in 6.5b currently),
added a second handle to drag the size at the "bottom" end,
center handle now has highes priority, so you can always drag it no matter which other overlaps it
image now should wrap correctly on all axis (didn't notice until then that LWs texture guide wrapped x and y mirrored too)
doesn't crash my Modeler 6.5b on exiting anymore (still donno the cause, it just stopped as i added another menu control)

Wow those were 7 fixes/updates :D
Oh and you get a brand new useless mapping type dropdown :p

Can soon begin to implement the other mapping types (planar should be "trivial") and try to add the ability to tweak non-UV mapped texture layers with it too (correctly, on all channels and layers...but i don't promise that yet. Maybe if Newtek leaves me a 7.5 update :D)

jin choung
03-20-2003, 05:20 PM
AWESOME!!!

i swear to god, get this going completely and just sell it back to newtek! they need this!

i work in gaming too and in testing it out, it fixes a lot of the weirdness that you get with the original texture guide! very nicely done.

and the "fix seam" button works GREAT!

a few points:

1) HEADING gets messed up when you rotate the gizmo in pitch or bank. heading should always be "local" heading right? that is, it should be "twist". but after you rotate on other channels, heading seems to be in an altered "world space" which is not as helpful.

2) you should document the tool - on the gizmo, is there any indication where the SEAM would be? it would be really nice to have SEAM markers on the gizmo... and if you end up doing a spherical projection, the seam markers would be more important. the "THIS WAY UP" indicator is awesome! more like that!

3) AUTOMATIC SIZING would be great! i really really miss this in texture guide - they have this essential tool for surfaces but not for the uv gizmo?!

TWO varieties of AUTOMATIC SIZING would be awesome too -
A. automatic sizes MAINTAINING SQUARE ASPECT RATIO
B. automatic sizes without maintaing square....

great work.

seriously, fix it, and sell it to newtek!

jin

Lynx3d
03-23-2003, 12:23 AM
I don't know what Maya's gizmo looks like, but i'll think about scaling on all axis if most of the rest works, rotation will get a bit trickier though...

The automatic sizing is in progress...there will be at least a button to make it fit the selection, and if i have an ingenious idea it could even work realtime...but i'm afraid it'd have to do all the transformation calculations a second time...but then again it takes quite some code to bog down 1GHz+ of CPU power...

Sorry no new version yet, just waaaay to messy to present anyone.
I really need to find out how to put controls on different tabs, the numeric panel is about to explode :D
But you'll have planar mapping soon...

Without Ernie Wright answering my question on the yahoo group i'd be stumped anyway :D
I'm pretty much a C newbie after all...

@jin: Heading is the last rotation applied, so it is not "local", it's always around the y-axis. Bank is the first rotation, meaning that it rotates with the other two. Just like in Layout. Now it's your turn to figure out why i chose Z as default axis :D
If someone had pointed out that LW's Textures Layers rotate completely different (reverse order, just to annoy me huh?) i may not have done Layout-style HPB rotations...

Lynx3d
03-24-2003, 04:54 PM
Ok, although the numeric panel still does explode (half the screen height at 1280x960 :D) i decided to put up another "preview".

Just found out that i adopted another "mistake" (or let's say divergence from the texture mapping within surface editor) from the original texture guide...

New features:
- Planar mapping
- Autosize button

Also it gets drawn properly now when it is activated by changing one of the values.

jin choung
03-24-2003, 06:51 PM
awesome!

everything works. and nicest of all is that by default, when you switch axes, it does an autosize for you which is an excellent default setting.

ideally, the autosize should have a SQUARE (keep square aspect ratio) for the planar and CIRCLE (keep projection cylinder from deforming) but these can be fixed by hand with numerical entries. no big deal.

but it's GREAT to have autosize in uveditor! not to mention that it will correctly autosize to SELECTIONS! great work!

fix seam works well but not perfectly. not sure if it's possible to make it work perfectly. but the occasionaly abberrant poly is easily cleaned up afterward.

but for the cylindrical projection GIZMO, you should get rid of the PLANE that goes down the radius of the cylinder. it's CONFUSING! what does it denote? i know newtek has it in their own but you should ditch it if you can. better thing would be to not have a PLANE but have a simple LINE that rotates around the surface of the cylinder that will describe the position of the SEAM.

and for consistency's sake, you should have an UP ARROW on the planar projection too.... that's a nitpick.

but not having a reliable H P B can indeed make it very difficult to use the gizmo for oddly oriented, non-orthographic objects and/or parts.

it does indeed sound like a limitation of the lightwave sdk but there's got to be a way to get a LOCAL SPACE hpb - so that h always twists the tube around its length.... maybe ask newtek....

anyhoo, great, fantastic, super work. and i love the name now... it is indeed TG2 and hope you can indeed sell it back to them.

jin

bearmandb
03-26-2003, 02:17 PM
Hi I saw on your first post that you will share your source code.

I'm interested on see it, only to givi it a try programming modeler plugins and know a bit more about UV coordinates generation programs.

Thanks and good work.

TerryFord
04-01-2003, 10:45 AM
I just got around to checking this plugin out. It's great! :D

Even at this stage I'd say it's a must-have tool. Good work Lynx3d, thanks for sharing.


Regards,
Terry

Lynx3d
04-04-2003, 06:11 PM
Hm, stupid question, does anyone know who from Newtek i could contact about whether they want it as new standard tool?

Not that i want to make big money from it, but some reward would be nice, my spare time isn't unlimited either :D
(hey at least i want to try before i just throw it out for free...)

I expanded the tool with spherical and cubic mapping (however cubic is and probably will stay limited to roughly what LWs texture guide does) and you can adjust any texture layer now too, so copy mapping settings and converting to UVs should be much easier now. Also expanded the Gizmo's with more scaling handles (still a bit beta)

One (already a bit outdated) screenshot:
http://www.bingo-ev.de/~mw1299/lw/tg_screen.jpg

TerryFord
04-04-2003, 06:41 PM
You could try Proton, he's listed as co-moderater here but I think he spends more time on CGTalk :) he might be able to tell you NewTeks policy on including third party plugins.

jin choung
04-04-2003, 08:48 PM
hey lynx3d,

basically, what you want to say is that very simply, you FIXED texture guide! when newtek did not.

that's not insignificant.

anyhoo, nice work and good luck on getting newtek to acquire it.

jin

private
04-04-2003, 08:50 PM
I hope you continue with this! This is an excellent asset to the toolset.

Lamont
04-28-2003, 12:31 AM
I've been messing with this for some time now and it's much needed.

You a baad mutha fu- **shut yo' mouth!!**...

Great work dude. More game tools!! MORE!!

jb_gfx
04-30-2003, 11:17 PM
This is a superb tool, you rulez!

Cman
06-14-2003, 09:14 PM
Thanks for making this!

CiaranM
06-14-2003, 09:16 PM
Pretty nice wee plugin you have there. Also, nice to to see Bodycount as your inspirational music. Ah Ice T what ever happened to ya.?

papou
06-15-2003, 02:48 PM
Thank you for this great tool !
wow, half of my tools are made by users!
thank you so much.

Lynx3d
06-15-2003, 05:14 PM
Oh i think i updated the file a while ago and didn't mention here...

Have no idea at which build it currently is :D
Well Newtek didn't show any interest, and i'm pretty busy currently. But some input would be nice nevertheless...don't be shy to report crashes, i always had some with 6.5b, however not with 7.5 and also they didn't make sense because they mainly occured when i did the exact same thing a second time...oh well, wouldn't be the only bug in LW 6.5b

Oh and a screenshot of a new feature (just because i needed it for that instance:
http://www.bingo-ev.de/~mw1299/lw/disc.jpg
Gizmo needs adaption but the "disc" mapping basically "straightens" circular but flat objects, like a brake disc...

TerryFord
06-15-2003, 06:19 PM
Cool, an update. I've been using it every day in my job, it's a big time-saver.

Thanks again Lynx3d, you should tell Flay.com about it so everyone can enjoy...


Regards,
Terry

Cman
06-15-2003, 07:57 PM
I was wondering what the disc thing is.
I've just been trying it out and it's MUCH better than the one that comes with LW!

You rock!

rapscallion
06-22-2003, 03:22 AM
Hey...Hi...does this plug exist in Mac format? And where can I read more about it? Thanks....wtb....ftv...j.p.r...

Lamont
06-22-2003, 11:20 PM
Can you have a checkbox to include all layers?

TerryFord
06-23-2003, 07:57 AM
Lynx3d, since you seem to have a good grasp of the UV thang, I don't suppose you could wip up a quick "Relax UV" tool? (I mean like Deep UV, not just a simple smooth operation) :D

No harm in asking :)


Regards,
Terry

Cman
06-23-2003, 08:37 AM
Yeah, any chance on that (Relax UV) happening?:D

Polymangler
07-04-2003, 02:10 PM
ya da man ;) thank you soo much for making this, Newtek if your watching, please take a few notes from this

Lynx3d
07-04-2003, 02:35 PM
Oh sorry, totally missed that email notification...

i have no idea what that Relax UV does, but if i look at the price of Deep UV it can't be that easy to code it :D
I'm open to Algorithms, but i'm neither a math- nor a coding genius :rolleyes:
(but i'm surely trying to improve...already planing another plugin)

Mac-Version...err...who was that guy that offered to compile stuff for Mac? I don't have anything Apple-ish nearby...

-edit-
oh yea, and if i find some time i should do a documentation of the plugin...

TerryFord
07-04-2003, 07:32 PM
There's a pretty good explanation of Relax UVs here;
http://www.unwrap3d.com/tutorial_relax.html
I did search for relax algorithms a few months ago with the vague idea of tackling it myself, but I came up empty.

Richard Brak is the Mac guy;
http://www.richardbrak.net/

Regards,
Terry

undergroundkg
12-12-2003, 04:33 AM
wow...this is amazing. it is so close to perfect.

Lynx3d
12-13-2003, 02:36 PM
Slight update:

http://www.aspect-design.de/lynx/LW/uvgen_beta1.zip

Also found a bug but couldn't fix it yet:
Do not launch the plugin on an empty unsaved and unmodified object (e.g. right after starting modeler) because it will crash modeler.
It doesn't make sense launching it in that case anyway, but just wanted to warn you :)

Besides some other small fixes it now remembers the settings from the last call.
Also has an option to play with, changing the rotation order so you can for example rotate a z-axis cylinder map more easily around its axis by setting "rotation order" to z (which actually means z->x->y rotation, just as in Layout in this case)

Am still thinking about a local coord system...and i think i just got an idea while writing this...also there might be yet a new mapping type...or two :D

Dodgy
12-13-2003, 06:23 PM
Thanks Lynx, it's great.

When I try using it the second time, it doesn't display till I change a value/click somewhere (it does remember the previous uses settings though...)

blabberlicious
12-14-2003, 07:11 PM
Oh my god!

I can't wait to try this out.Thanks for the time you've put into this.

Please, MAC users, if you have any sense, will you bombard the very noble Richard Brack with requests to get this ported!

And I thought it was just me that couldn'tget Texture Guide to Map 'off axis'.

It AMAZES me that NK show no interest in rewarding someone for fixing bugs their tools.

NT Listen up! You are hyping LW8 as being such a killer Charcter animation tool...

then make sure the freakin' tools that you've given us texture artists actually work!!!!

I know LW8 may be an orgy of Layout enhancements, but I had to buy Maxon's Bodypaint 2 to get workable interactive mapping.

What is it with you guys?

Did you just give up?

Please, a Mac version!

(o you PC users ever tire of hearing our pitiful cries!)

jin choung
12-14-2003, 07:28 PM
lynx 3d,

you really do deserve a medal. and if newtek does nothing else for modeler except acquire your excellent TEXTURE GUIDE 2 and properly recompense you for your effort, it would assuage my rage.

it is an absolute travesty that they would show no interest in this!

are they out of their minds?

asleep at the wheel?

they really really don't care about modeler?!

hell, we have you on the one hand who's wracking his brains on his own time trying to figure out local axis issue and what pray tell is newtek doing about their buggy as hell TG1?

sigh.

shaking my head in nauseated disbelief.

in any case, you rule lynx 3d. and your effort has got to result in good things for you... it has to.

jin

blabberlicious
12-14-2003, 07:44 PM
Originally posted by jin choung
lynx 3d,

it is an absolute travesty that they would show no interest in this!

are they out of their minds?

asleep at the wheel?

they really really don't care about modeler?!

jin


You are so right my friend.

Those NT guys have got their pony tails twisted too tight - I think it's affecting their vision..

I can imagine the scence at NT development:

....Pages of 7.5 bug fixes for Modeller, gathering dust....

Them inspiration strikes;

Coooool! I've got a fix for all the stuff that don't work - Viper, HUB, Modeller tools - the lot!

What?

Let's ignore them, and chuck in a truckload of rigging tools......'

They are cheap to buy....and, hey, they may actually work!

What are UVs anyway?

err, something to do withthe sun?



You get the idea.

blabberlicious
12-15-2003, 03:38 AM
Hey Lynx3d!

I contacted Richard Brak last night, and he very kindly offered to try to compile a Mac version...

He suggested it was better if you contacted him directly:

r.brak@richardbrak.net

Us Mac chaps would greatly appreciate this.

BTW iif you crack relaxing UVs, you'll have pretty much solved much of what's frustrating about UV Editing in LW, and turned it into a beast of an UV editor!

I just bought Bodypaint, only to find it has no means of quickly tidying up maps, algining rows of points...all of which is a snip in LW.

Lynx3d for president!

Cheers

Lynx3d
12-15-2003, 06:50 AM
Don't be so hard to the Newtek guys...i'm sure they're working hard. There are MANY tools and my effort just fixes one of them...

Besides, i just noticed another Modeler bug... :D
in Front/Back viewports the moving contraints are interchanged...it contrains to x when it should to y and vice versa...seems like i have to fix manually...oh yea code keeps blowing up (ok that might be due to my bad coding skills too actually...)

But, no time today, gotta learn some quantum mechanics and semiconductor stuff... :(

I'll contact Richard Brak, let's see if he can get my messy code to compile :D

blabberlicious
12-15-2003, 07:29 AM
Hey, fair point - the NT guys are ace.

It's just frustrating that a tool that we UV Freaks would love to take advantage of is 'broken'-

And I was a bit shocked that NT didn't seem intersted in your attempts to fix it for them.

But I guess they are busy

(understatement of the year!)

We really appricate you efforts to make amends.

Thanks again.

Look forward to the Mac Version (fingers crossed)

blabberlicious
12-15-2003, 08:05 AM
Just tested it out on a PC - amazing!

can't wait!

Lynx3d
12-15-2003, 04:26 PM
Oookay...Richard gives it a try :)

I'm also writing a documentation so you can actually understand what the features are about etc.
Just finished the first draft...but didn't have the time to insert screenshots etc.
It'll be online soon.

And the maybe some of my other plugins get "late beta" soon too ;)

Lynx3d
12-17-2003, 06:57 AM
Ok, finally made a minimalist site and uploaded the stuff:

http://lynx.aspect-design.de/plugins/texguide2_info.htm

Now available for Windows, MacOS9 and OSX!
R. Brack said the Mac versions work, so i hope it does :D
Also wrote some basic documentation to get you started.

Cman
12-17-2003, 09:17 AM
Thanks Lynx3d.

dbolto
12-17-2003, 09:53 AM
Lynx,

Thanx for making UV'ing easier!!

dbolto

www.dbolto.com

jeanphi
12-17-2003, 04:38 PM
It's a great tool!

Now what I would like to see is an option to chose one normal of a poly as the ref axis (first or last selected for example). Then local adjustments.
It will be so helpfull!

blabberlicious
12-18-2003, 06:54 AM
Thanks soo much for making this great tool available to mac users.

I agree about being able to choose a poly nornal, it would be icing on the cake!

Please note

You've got the filenames on the mac plugins the wrong way round.

I was in tears, thinking it didn't work ;-)

The OS9 Version is actually the OSX one.

Hooray!

Also note, if you install the plugin and run without creating an object an object, Modeller will crash.
No big deal.

Thanks again Lynx3d & Richard.


Relax UVs
If you could now turn you talent to providing this, too - you have the undying love of all us LW Modeler freaks.

It would also provide you with a pretty complelling case for including as part of their product, because NT are way behind other apps in this respect.

At present, I have to interactivelly map UVs and relax em in BODYPAINT 2, which doensn't have nearly as good point editing tools.

So you are half way to heaven!

Cheers

Lynx3d
12-18-2003, 09:01 AM
Hm i already thought it sounds odd to have a .sitx being the OS9 plugin.
So, the OS9 archive is actually the OSX plugin? Gotta change that, i took them how Richard send 'em to me...
(btw, is stuffit integrated to MacOS, or why doesn't anyone seem to use more common stuff like zip, rar, ace, bz2 or anything?)

Surface normal...have to think about that one. But currently i'm more into bugfixing (already caught some...)

Relaxing UVs...well if that was as easy as you guys think it is...couldn't find enough information on how to build the algorithm yet. And i'm not really a genious when it comes to solving differential equations...and they have to be solved numerical. So if anyone wants to help... ;)

munky
01-01-2004, 03:18 PM
Hi Lynx

I thought I'd try out your OSX version but when I double click on the file it just opens a new web page filled with gobbledy gook. Is it broke? I downloaded the OS9 version no problem but I don't use os9. I'm using OSX 10.2.1 Any thoughts?
Or is it just me.

regards

paul

blabberlicious
01-01-2004, 07:12 PM
Errr....

The os9 version has been incorectly named. It's the OSX one.

Scroll up a few posts...and read what I wrote

Rgards

:-)

munky
01-02-2004, 05:38 AM
Hi there Blabberlicious

Maybe it is me but the one that says it's an os9 plugin (the .sit file) that I can get to download; won't load into lightwave so I'm guessing it's now the os9 version and the .sitx file comes up as a web page with loads of text in it.
If you have the time could you try downloading they and telling me it's just me or not.

regards

paul

blabberlicious
01-02-2004, 05:47 AM
I get you....

Just Control Click on the link to Disk,

and choose ' Download Link to Disk' from the contextual menu that pops up.



that will do it....

Best
Steve

proteus
01-02-2004, 06:00 PM
you mentioned something about source code... something like "if anyone wants the source, as for it"....

..Can we PLZ PLZ PLZ have the source?

jin choung
01-18-2004, 12:11 AM
as for relax uvs,

that's a great idea but it seems to be beyond the purview of texture guide 2.

it would more be like an operation that happens in uvspace after the fact.

jin

Lynx3d
01-18-2004, 09:19 AM
Oh must've missed the last activity...

Source code...well i'm still thinking about what conditions i should release them...best would be some GPL only excluding myself from the duty of releasing the source for every new binary release...

Hm i fixed some bugs, think i should bump version to Beta2 and mail Richard again.

About the relax UV, i actually found a place that has source codes for the whole Runge Kutta numerical integration, perhaps that will be the project for next hollidays...

JSensebe
03-29-2004, 05:39 AM
There's a Sun Java sample that does something very similar to the relax UV thing, as I understand it. It's the GraphLayout example in the Java SDK. Since there's source code, being an SDK sample, you might be able to learn a bit from it.

Lynx3d
03-29-2004, 08:07 AM
Me and Java...omg :D
(actually i never really tried to understand Java)

Thx anyway, but what you guys didn't know, i actually have a somewhat working relax-uv on my machine already...

It seems to be capable of what Ultimate Unwrap3d can do, actually can handle some cases where i had no luck with Ultimate Unwrap.

However that Runge-Kutta gives me headaches.
Thought i am smart and directly use the algorithm for 2nd order differential equations (instead of using two vague "guesses" like with Euler's method) but it doesn't seem to work acceptable...

here's a small sneak preview:
http://lynx.aspect-design.de/stuff/relax1.png
(that's a frozen subpatch that has been cylinder mapped and then frozen)

papou
03-29-2004, 08:30 AM
nice work Lynx3d!

IgnusFast
03-29-2004, 11:01 AM
Originally posted by Lynx3d
Thx anyway, but what you guys didn't know, i actually have a somewhat working relax-uv on my machine already...

It seems to be capable of what Ultimate Unwrap3d can do, actually can handle some cases where i had no luck with Ultimate Unwrap.

However that Runge-Kutta gives me headaches.
Thought i am smart and directly use the algorithm for 2nd order differential equations (instead of using two vague "guesses" like with Euler's method) but it doesn't seem to work acceptable...

here's a small sneak preview:
http://lynx.aspect-design.de/stuff/relax1.png
(that's a frozen subpatch that has been cylinder mapped and then frozen)

Wow, man. That's cool as hell! I had no idea what you guys were talking about until I saw that illustration!!! I just did my first UV map this weekend, and now I can definitely see a use for something like that...

dbolto
03-29-2004, 11:25 AM
Lynx 3d any idea when you are going to unleash this new UV beast to the world or is it still quite aways off?

dbolto

UnCommonGrafx
03-29-2004, 11:53 AM
Big Daddy!!

Lynx3D, I think you have a winner!!

Well done on the tool shared and well done on your example. Exciting stuff, to say the least.

Thanks for your efforts.

JSensebe
03-29-2004, 02:05 PM
Java isn't that hard to read, especially if you know C++. Besides, you'd only be bits that iterate over the edge list and node list and do some math.

By the way, I was planning on writing this myself if I didn't find someone who was already doing it. Good luck!

Cman
03-29-2004, 03:05 PM
Originally posted by JSensebe
Java isn't that hard to read, especially if you know C++. Besides, you'd only be bits that iterate over the edge list and node list and do some math.

By the way, I was planning on writing this myself if I didn't find someone who was already doing it. Good luck!

He's apparently looking for some help - maybe you could chip in! :D

Lynx3d
03-29-2004, 03:25 PM
hehe
that's not too far-fetched...

Guess this time i'll really provide the source code under the GPL on my homepage. But as always the code is a bloody mess...

Meanwhile, you can play with the very first ->test version<- (http://lynx.aspect-design.de/plugins/relax_uv_info.htm)
Hope the documentation is any good...

Also worked a little bit on my homepage, but it's still far from finished... :(
At least you can contact me now...if you find the link *lol*

And i hope it doesn't look too awfull with Internet Explorer...couldn't resist using some PNGs with alpha channel...

Cman
03-29-2004, 04:25 PM
What is a good way to test your RelaxUV plugin?

JSensebe
03-29-2004, 04:34 PM
I tried it on a human head model I'm working on and it kept saying, "something went wrong". :confused:

Cman
03-29-2004, 04:52 PM
Originally posted by JSensebe
I tried it on a human head model I'm working on and it kept saying, "something went wrong". :confused:

That's why I wonder would it be useful to start on simple cubes, then spheres, and build up to more complex geometry?

JSensebe
03-29-2004, 04:56 PM
I got it to work on a capsule, but not on the face or a teapot.

Lynx3d
03-29-2004, 05:39 PM
Yea i obviously screwed something when putting the new UI in...

but honestly, i have no idea what...bummer.

-edit-
Hm i think it could be something else.
Be sure to only have selected one Layer and have no polygons hidden! Am not sure why hidden polygons cause my points array to be incomplete...

JSensebe
03-29-2004, 06:04 PM
I got past the "something is wrong" message on the head, but now it's moving the UV coordinates very far to the right (+U) and down (-V). The teapot still gives the message.

tudor
03-30-2004, 03:09 AM
A trick that I use to get that realax function in LW is to first unwrap to an endomorph (menithings method), and then running a smooth command on it.. Only after that do I create the UV's. Wouldn't the easiest way to code this plug be to to copy the map to an endomorph, run smooth, and then paste back to the UVmap? Saves you the trouble of coding the smoothing algorihm.

TerryFord
03-30-2004, 10:31 AM
Nice work Lynx3D! Relax seems to be working quite well here.

Sometimes an Unweld/Merge operation will clear the "something went wrong" error and allow RelaxUV to do it thang.

I'm getting good results with iterations at 1000 and Quad Substructure on. It's still very useable, even this slightly tempermental version. Thanks for making this available.


Regards,
Terry

meatycheesyboy
03-30-2004, 12:42 PM
Originally posted by tudor
A trick that I use to get that realax function in LW is to first unwrap to an endomorph (menithings method), and then running a smooth command on it.. Only after that do I create the UV's. Wouldn't the easiest way to code this plug be to to copy the map to an endomorph, run smooth, and then paste back to the UVmap? Saves you the trouble of coding the smoothing algorihm.

From my understanding, relax is alot different than just a smoothing algorithm. With smooth, LW just takes all of the point distances and evens them out but with relax, it would take all of the UV point distances and actually try and make them relate to the mesh's point distances. So, if you have a mesh that has even poly distribution then the two would be very similar but if you have a mesh with a wildly vary poly distribution, smooth and relax would look completely different.

I may not be grasping the concept correctly though, if someone else can shed some light and explain it better, it would be most appreciated.

Lynx3d
03-30-2004, 03:01 PM
Should probably start a new thread...

If someone has an object with preferable as few polygons as possible that gives an error (although there is only one layer selected and no geometry hidden) i'd like to have to investigate what's going on.

As for smoothing vs. relaxing, it is something substatial different. Perhaps both can help you get a better UV-map but that doesn't make them equivalent. I tried to explain how it works in my (pretty incomplete) documentation, in case someone bothered to look at it.

You can also have a look at http://www.unwrap3d.com/tutorial_relax.html for some different explanations and little tutorials. You may also want to try Ultimate Unwrap...

JSensebe
03-31-2004, 02:43 AM
Use the Teapot tool to make a teapot. Then create a spherical map for it (Make UVs, default settings otherwise). I've never gotten that to relax. In fact, it crashed Lightwave last time I tried.

There's definitely something weird going on somewhere.

DarkLight
03-31-2004, 03:07 AM
I tried this on a head model which i created a UV map on in UV Edit Pro. No matter what combination i try i always get an error message.

JSensebe
03-31-2004, 04:04 AM
Yeah. I get that most of the time on my head model, too, but when I don't, it takes vertices, starting with the eye sockets, and sends then very far to the right (+U) and down (-V). So far, in fact, that I can't seem to scroll far enough to find them.

I've tried copying the mapped polygons to a new object and relaxing there, but it doesn't seem to help.

Is it possible that it's getting a division by zero when points coincide in UV space? The area inside the eye sockets is pinched down to a point in the UV map. I know the algorithm in that Java sample I mentioned computes the length between the points and divides stuff by it. It might be useful, if that is the problem. to convert lengths of zero (in UV space) to very small lengths instead. Of course, if the length between the points is zero in model space, that's another matter, but should be handled somehow.

Lynx3d
03-31-2004, 12:52 PM
OMG...if stupidy hurted...i'd be dead by now :D

Just to clear it up:
Usually when you just loaded the object in Modeler all PointIDs are sorted when you do a Pointscan. But, after some editing they can get pretty shuffled. Now the problem is not that i didn't consider this, but, before i made the version for you to test, i threw out those code lines that give info no one except me is interested in, and unfortunately the sorting was combined with a notification and i simply overlooked it when commenting it out :D

Also added some more differentiated error messages now, and fixed a little memory leak (but you'd have to run it hundreds of time to get a few wasted kilobytes...)

As for the teapot, it's pretty futile to expect a spherical mapped teapot to become mapped perfectly by slapping relax at the whole mesh, sorry but that'll never give you desireable results. Perhaps a 1D-Relax could do something...this way it'll alway bulge so you don't get a clean seam...like attached.

It usually works best for local optimizations, meaning you select part of your mesh where texture strechtes a lot, then run relax with fixed border and relative scale between 0,9 and 0,7.

JSensebe
03-31-2004, 02:58 PM
Originally posted by Lynx3d
As for the teapot, it's pretty futile to expect a spherical mapped teapot to become mapped perfectly by slapping relax at the whole mesh, sorry but that'll never give you desireable results. Perhaps a 1D-Relax could do something...this way it'll alway bulge so you don't get a clean seam...like attached.
Well, the problem wasn't in getting satisfactory results. I wasn't getting any results whatsoever.

I downloaded the new version, and now it works on my head model. It did a great job on most of the head, and then I went back and tweaked areas like the ears, nose, and mouth. Great job!

JSensebe
04-02-2004, 10:27 PM
It still seems to have trouble with the areas inside the ears, eyes, nose, and mouth. Even if I "untangle" the points, it tends to tangle them back up, which it probably should never do. Would it be possible for me to see the source code? I might be able to spot something, since I'm familiar with the process.

I just want to make this tool as good as it can be, without having to code it myself. ;)

A few things off the top of my head:

-- Don't update the UV coords as you go along. Accumulate offsets for each point, and then add them to the coords at the end of the cycle.

-- Deal with "quad substructure" for polygons with greater than four points by simply connecting every point to every other point in the polygons (being careful not to add the polygon edges twice).

Lynx3d
04-02-2004, 11:55 PM
Ok...just applied the GPL and uploaded it:
http://lynx.aspect-design.de/LW/relaxUV_source.zip

Hope i didn't mess it up in a way it won't compile.

-- Don't update the UV coords as you go along. Accumulate offsets for each point, and then add them to the coords at the end of the cycle.

Not sure what you mean, the UVs get converted to doubles and updated after each pass. If you think it makes that much of a difference only saving the offset seperately try it, but i doubt it.
The reason is rather the bad integration method, it's error is magnitutes larger than any rounding error...unfortunately.

-- Deal with "quad substructure" for polygons with greater than four points by simply connecting every point to every other point in the polygons (being careful not to add the polygon edges twice).

Hehe, if it's so simple then you surely can describe it formally... :P
Honestly, i'd have to do some search about combinatorical functions. Getting the number of all possibilities is not hard, but naming all pairs...i don't know that out of my head.

Well then, good luck at understanding my weird logic ;)
(btw, if you know a precise method to predict the exact amount of memory to be allocated, instead of an upper limit, let me know...i decided against linked lists because heavy pointer operations proved to be the most efficient brake on my image filters...)

DarkLight
04-03-2004, 03:34 AM
Hi Lynx3d,

I just downloaded the source code and it seems to compile fine for me using Visual Studio.NET.

I'll take a look at the code later and see if i can find out why it's not working on my head model. I'll let you know if i find anything :)

JSensebe
04-05-2004, 06:02 AM
I came up with something last night. When I don't lock boundaries, the coordinates fly off to Never Never Land. It might be a good idea to lock a single vertex (closest to the center of the selection?) when not locking boundaries.

Gollum
05-27-2004, 08:59 PM
Just wanted to say thanks for sharing this pugin with us, even in its current unfinished state it has many uses. On a model of mine I ran into serious texture distortion today. No matter how I dragged the points manually, I couldn't get rid of it. I ran the relaxUVs plugin on a selection of these wrinkles and it nicely averaged out the UV map.

Not perfect yet to smooth out an entire mesh - next time I will try to create the UV Map with more firesight to avoid such a situation - but as it happened, relaxUVs saved me a ton of tweaking. Cheers Lynx3d, great work on this and your other plugins! :)

wrosado
05-27-2004, 10:14 PM
This is a fantastic plug you've written! I just tried it out on a simple model i have(a basketball with the groves modeled in it) and it worked wonderfully!!! The joy was only short lived tho... when i turned on sub-ds the textures were stretched. Had to tweak that...

great start to a killer plugin!

http://willus.fignuts.net/basketballwire.jpg