sibarrick Posted October 17, 2007 Share Posted October 17, 2007 Ok so the nights are drawing in and the summer has gone, in England any way.. so I'm poking around with a bit more code. I've been looking at texture unwrapping using LSCM. As used by the Blender and Roadkill apps among others. There's still much to do but here is an initial cut, usual warnings apply. When its a bit further along I'll post it up on Houdinitools I couldn't get it to work with the HDK built in matrix solvers so I've used OpenNL which is very easy to include, I think its pretty cross platform but I'm only working on windows, maybe someone on Linux can test for me??? Currently the list of things to do is as follows in rough order of importance 1. Automatically create seams from a user input edge list. Currently I use my point slide sop to do it just because it was there and did the job. 2. Add support for groups 3. Add colour coding of the stretching after the unwrap - this might be handy as a seperate sop actually (Sesi?) 4. Add ABF to the LSCM method to improve the unwrap for certain cases 5. Optimise the code by using SuperLU Its pretty much usual as is but adding ABF will be important I think. Adding SuperLU support will mean it can handle super sized meshes, the test one I used is fairly light but pretty typical I think, it solves pretty fast so its very usuable. TextureUnwrap.zip Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted October 17, 2007 Share Posted October 17, 2007 (edited) Hey Simon, I've just tried to compile your SOP under Linux with HDK 9.0. There are some errors related to C++: >/usr/bin/g++ -DUT_DSO_TAGINFO='"3262197cbf1359152da71e83421a82e5381f86a28f7c87fa59d592554743ed893fde2a8e853269430602adc7248e310d5ceee407f5d6e05e47063dea67fa96865bbe45a0ff924994a364d41247ba50acea6e94a384e7f3"' -DVERSION=\"9.0.734\" -DDLLEXPORT= -D_GNU_SOURCE -DLINUX -DI386 -march=i686 -DSESI_LITTLE_ENDIAN -DENABLE_THREADS -DUSE_PTHREADS -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DOFSTREAM_PERMISSIONS="" -c -DGCC3 -Wno-deprecated -I/opt/sidefx/hfs9.0.734/toolkit/include -I/opt/sidefx/hfs9.0.734/toolkit/include/htools -Wall -W -Wno-parentheses -Wno-sign-compare -Wno-reorder -Wno-uninitialized -Wunused -Wno-unused-parameter -O2 -DMAKING_DSO -o SOP_UVunwrapLscm.o SOP_UVunwrapLscm.c In file included from SOP_UVunwrapLscm.c:36: include/nl2.c: In function `void nlGetFunction(NLenum, void**)': include/nl2.c:3667: error: invalid conversion from `NLboolean (*)()' to `void*' include/nl2.c:3670: error: invalid conversion from `void (*)(double*, double*)' to `void*' include/nl2.c:3673: error: invalid conversion from `void (*)(double*, double*)' to `void*' SOP_UVunwrapLscm.c: In member function `void SOP_UVunwrapLscm::lscmMatrix(GU_Detail*)': SOP_UVunwrapLscm.c:302: warning: unused variable 'row1' SOP_UVunwrapLscm.c:303: warning: unused variable 'row2' SOP_UVunwrapLscm.c: In member function `int SOP_UVunwrapLscm::splitVertices(GU_Detail*)': SOP_UVunwrapLscm.c:457: error: variable `GB_PointRefArray prefarr' has initializer but incomplete type SOP_UVunwrapLscm.c:488: error: no matching function for call to `GEO_Closure::findPolysUsingEdge(GEO_Point&, GEO_Point&, UT_IntArray&, <type error>)' /opt/sidefx/hfs9.0.734/toolkit/include/GEO/GEO_Closure.h:56: note: candidates are: void GEO_Closure::findPolysUsingEdge(const GEO_Point&, const GEO_Point&, GB_PrimitiveGroup*, GB_PointRefArray&) /opt/sidefx/hfs9.0.734/toolkit/include/GEO/GEO_Closure.h:63: note: void GEO_Closure::findPolysUsingEdge(const GEO_Point&, const GEO_Point&, UT_IntArray&, GB_PointRefArray&) SOP_UVunwrapLscm.c:489: error: no matching function for call to `GEO_Closure::findPrimsUsingPoint(GEO_Point*&, UT_IntArray&, <type error>)' /opt/sidefx/hfs9.0.734/toolkit/include/GEO/GEO_Closure.h:67: note: candidates are: void GEO_Closure::findPrimsUsingPoint(const GEO_Point*, GB_PrimitiveGroup*, GB_PointRefArray&) /opt/sidefx/hfs9.0.734/toolkit/include/GEO/GEO_Closure.h:74: note: void GEO_Closure::findPrimsUsingPoint(const GEO_Point*, UT_IntArray&, GB_PointRefArray&, unsigned int) SOP_UVunwrapLscm.c:480: warning: unused variable 'count' SOP_UVunwrapLscm.c:461: warning: unused variable 'test' SOP_UVunwrapLscm.c: In member function `void SOP_UVunwrapLscm::defaultPins(GU_Detail*)': SOP_UVunwrapLscm.c:652: warning: unused variable 'i' SOP_UVunwrapLscm.c: In member function `virtual OP_ERROR SOP_UVunwrapLscm::cookMySop(OP_Context&)': SOP_UVunwrapLscm.c:845: warning: unused variable 'i' Compile failed Edited October 17, 2007 by hoknamahn Quote Link to comment Share on other sites More sharing options...
sibarrick Posted October 17, 2007 Author Share Posted October 17, 2007 (edited) Cheers! I'll see if there is anything I can do to fix them. I should have said too, my compile is under H8.2.13 I haven't moved over to H9 yet. Edited October 17, 2007 by sibarrick Quote Link to comment Share on other sites More sharing options...
Jason Posted October 17, 2007 Share Posted October 17, 2007 Cheers! I'll see if there is anything I can do to fix them.I should have said too, my compile is under H8.2.13 I haven't moved over to H9 yet. Well done, Simon! Great to see this out there:) EDIT: Added to wiki LSCMMapping Quote Link to comment Share on other sites More sharing options...
MADjestic Posted October 18, 2007 Share Posted October 18, 2007 You are my hero Simon! Not that I do much texturing (if any at all), nevertheless - you are. =) Quote Link to comment Share on other sites More sharing options...
altbighead Posted October 18, 2007 Share Posted October 18, 2007 well done.I don't have much to add but I have been using this headus uvlayout and by far the most efficient and fastest way to layout uv. http://www.uvlayout.com/index.php?option=c...r&Itemid=38 Quote Link to comment Share on other sites More sharing options...
sibarrick Posted October 18, 2007 Author Share Posted October 18, 2007 (edited) I notice a lot of these uv apps have the ability to auto pack multiple sections into one set of uv coordinates, I think if I add group support I'll leave it to the user to pack the groups themselves using the output ranges. You probably end up with a better pack that way anyhow and it saves me a lot of work. Anyone know what this error means SOP_UVunwrapLscm.c:457: error: variable `GB_PointRefArray prefarr' has initializer but incomplete type the line it refers to is this GB_PointRefArray prefarr(gdp,0); It compiles fine on windows and not on Linux... Edited October 18, 2007 by sibarrick Quote Link to comment Share on other sites More sharing options...
sibarrick Posted October 18, 2007 Author Share Posted October 18, 2007 (edited) updated code... number of linux fixes, plus colour coding for stretching... TextureUnwrap.zip Edited October 18, 2007 by sibarrick Quote Link to comment Share on other sites More sharing options...
photex Posted October 19, 2007 Share Posted October 19, 2007 updated code...number of linux fixes, plus colour coding for stretching... Thanks very much for giving these to the community! If you are ever interested in a shell account to a linux box on which you can test building these, then PM me. 64-bit suse is the flavor. Quote Link to comment Share on other sites More sharing options...
cellchuk Posted October 19, 2007 Share Posted October 19, 2007 updated code...number of linux fixes, plus colour coding for stretching... thanx for sharing :thumbsup: Quote Link to comment Share on other sites More sharing options...
sibarrick Posted October 27, 2007 Author Share Posted October 27, 2007 (edited) There's a new version with seam splitting... TextureUnwrap.zip Edited October 27, 2007 by sibarrick Quote Link to comment Share on other sites More sharing options...
LEO-oo- Posted October 28, 2007 Share Posted October 28, 2007 Good job! I have a problem with the symmetry. There is also this one point (circle). The geometry is really strange - let me know and I will send the model for testing. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted October 28, 2007 Author Share Posted October 28, 2007 Yeah, I don't think this method works for every single topology, hence the need for the ABF function. Things improve as you add pins and different seams. But please post hip files incase its something dumb that I have done. Quote Link to comment Share on other sites More sharing options...
LEO-oo- Posted October 28, 2007 Share Posted October 28, 2007 @Simon In your mail... Quote Link to comment Share on other sites More sharing options...
sibarrick Posted October 28, 2007 Author Share Posted October 28, 2007 (edited) deleted.. Edited October 28, 2007 by sibarrick Quote Link to comment Share on other sites More sharing options...
sibarrick Posted October 28, 2007 Author Share Posted October 28, 2007 a few bug fixes... TextureUnwrap.zip Quote Link to comment Share on other sites More sharing options...
LEO-oo- Posted November 1, 2007 Share Posted November 1, 2007 Works great now - thank you! I have only a problem in the eye-regions with overlapping UVs. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted November 1, 2007 Author Share Posted November 1, 2007 (edited) From what I understand of this method in order to fix those areas you need to add some more pins. Pick a couple of vertices in each of those areas and create uv pins for them that are a little further apart. If you do a search for tutorials on LSCM you'll find quite a few that use blender Blender tut 1 Blender tut 2 Blender tut 3 and others Other The workflow is different but the results and issues should be much the same. I've posted a basic workflow tut on my website for using my sop, hopefully you can apply that to the above tuts. PS the quickest way to sort out the situation you show is with the UVbrush in smooth mode... Edited November 1, 2007 by sibarrick Quote Link to comment Share on other sites More sharing options...
LEO-oo- Posted November 2, 2007 Share Posted November 2, 2007 I tried to use more PINs, but the result was not this good. But tweaked a bit the PinUVs of the original set and it is much better. I have still a problem with the ears. The UVuniform-SOP is a solution? Quote Link to comment Share on other sites More sharing options...
sibarrick Posted November 2, 2007 Author Share Posted November 2, 2007 (edited) Yes UVuniform or do the ears seperately... Actually it would be interesting to compare it with the UVpelt sop to see the differences of the two approaches. Edited November 2, 2007 by sibarrick Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.