Jump to content

Help with UVS & Blender, what are they?


JCPalmer
 Share

Recommended Posts

I have been doing more testing of the Automaton / ShapeKeyGroup exporting from Blender / Tower of Babel.  I have added a material with a texture to a mesh called Cloth that also has shapekeys.  I had the hardest time getting any material to show textures from export, even though they looked perfect in Blender with F12.  Finally isolated why using the camera-anim model.  The cubes with textures also had a UVS Map thing.

 

Everything was fine when I added a UVS to a non-shapekey mesh, Ground.  When I added a UVS to Cloth, the number of positions changed, but not the number of indices.  Crucially, the length of positions no-longer matched the length of the raw shapekey, hence the length error.

 

My programming skills are exponentially better than graphics skills.  Is there something I did wrong?  BTW,  I added a new warning if textures are detected in a mesh, but UVS not found.

 

Here is  the log file with Cloth has a texture, but no UVS (it worked in Babylon, but solid color)

	Tower of Babel version: 1.0.0, Blender version: 2.69 (sub 0)========= Conversion from Blender to Babylon friendly Python objects =========	Python World class constructor completed	processing begun of material:  automaton.cloth-like	processing begun of material:  automaton.ground-like	processing begun of mesh:  Ground		num positions      :  4		num normals        :  4		num uvs            :  8		num uvs2           :  0		num colors         :  0		num indices        :  6	processing begun of mesh:  Table		WARNING:  No materials have been assigned: 		num positions      :  8		num normals        :  8		num uvs            :  0		num uvs2           :  0		num colors         :  0		num indices        :  36	processing begun of mesh:  Cloth		num positions      :  1156		num normals        :  1156		num uvs            :  0		num uvs2           :  0		num colors         :  0		num indices        :  6534		WARNING textures being used, but no UVS found		Key shape not in group-state format, changed to:  ENTIRE MESH-Draped  	        DRAPED raw key length: 1156	processing begun of camera:  Camera	processing begun of light:  Sun========= Writing of scene file started ================== Writing of scene file completed ================== Writing of typescript file started ================== Writing of typescript file completed ================== Writing of javascript file started ================== Writing of javascript file completed ================== Writing of html files started ================== Writing of html files completed ================== end of processing =========

Here is the log file, after adding the UVS to cloth (errors in python):

	Tower of Babel version: 1.0.0, Blender version: 2.69 (sub 0)========= Conversion from Blender to Babylon friendly Python objects =========	Python World class constructor completed	processing begun of material:  automaton.cloth-like	processing begun of material:  automaton.ground-like	processing begun of mesh:  Ground		num positions      :  4		num normals        :  4		num uvs            :  8		num uvs2           :  0		num colors         :  0		num indices        :  6	processing begun of mesh:  Table		WARNING:  No materials have been assigned: 		num positions      :  8		num normals        :  8		num uvs            :  0		num uvs2           :  0		num colors         :  0		num indices        :  36	processing begun of mesh:  Cloth		num positions      :  5366		num normals        :  5366		num uvs            :  10732		num uvs2           :  0		num colors         :  0		num indices        :  6534		Key shape not in group-state format, changed to:  ENTIRE MESH-Draped	        DRAPED raw key length: 21========= An error was encountered =========  File "/home/jeff/.config/blender/2.69/scripts/addons/io_tower_of_babel.py", line 272, in execute    mesh = Mesh(object, scene, self.multiMaterials, nextStartFace, forcedParent, nameID)  File "/home/jeff/.config/blender/2.69/scripts/addons/io_tower_of_babel.py", line 1065, in __init__    self.shapeKeyGroups.append(ShapeKeyGroup(group, rawShapeKeys, self.positions))  File "/home/jeff/.config/blender/2.69/scripts/addons/io_tower_of_babel.py", line 1513, in __init__    if not ShapeKeyGroup.same_vertex(keyA.vertices[i],  positions[i]):ERROR:  list index out of range========= end of processing =========
Link to comment
Share on other sites

First little bit of 'progress' is that the raw shape key length is really 1156, not 21.  The 21 is a measurement of the key after it has been re-ordered, because the order of positions is manipulated for Babylon from Blender's order to support submeshes for multi-materials.  The order of each raw shape key has to be re-ordered as well.

 

Hopefully, there is a bug in the script at a higher level which will resolve this, though I am still puzzled by the change in the number of positions.
 

Link to comment
Share on other sites

Decided to turn-off shape-key generation on Blender side, & deformations on Babylon side to see what happens with the UVS added.  It generated 5366 positions with 6534 indexes.  It is evident that there is a pattern, but it is scaled oddly.  See attached pictures.  Is there some way to control this UVS, so the # of positions does not change?

post-8492-0-77225100-1409771078.jpg

post-8492-0-63243400-1409771093.png

Link to comment
Share on other sites

In playing with the Blender render, I was able to get the UVMap I added to the mesh to be applied to the material.  It now looks like the above Babylon screen shot.  Also included what Blender renders without making the texture use the map.  Maybe the question should be can Babylon 'generate a map', or can python API dig out the generate one?  If the shape-key and positions are not the same size,  I have no idea what to do.

post-8492-0-96623900-1409772969.png

post-8492-0-72483800-1409772981.png

Link to comment
Share on other sites

YES!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

After you add your UV Map, in the 3D window:

  • Put Mesh into edit mode
  • Select from the menu 'Mesh->UV Unwrap ...->Unwrap'

No need to mess with The texture mapping as shown above, unless you wish to see it in the Blender render too.  This stuff is finally starting to look real!

 

I probably need a new warning if the size of the shape key does not match the size of position, but right now I need a beer.  Launching a nuclear missile seems about as simple as Blender.  In-coming.

Link to comment
Share on other sites

Interesting!  Thanks for writing-up your discoveries on this.  An excellent contribution to the Babylon knowledge base.  I wish I could engage you in conversation on these subjects, but I just don't have the necessary experience in texturing and Blender operations. 

 

I learn things with every post you make, JC... and... thanks for that, too.  Everyone benefits from it, but maybe not immediately.  :)

 

Also, I am still watching (and thinking about) two of your forum posts... that received no replies.  I hope to somehow gun-down some answers for those, someday.  Posts without replies... bother me.  Sometimes I put no-help comments on them... just to bring them back to the top of the forum... in hopes someone can answer them.

 

All in all, keep doin' what you do, JC.  You're blazing excellent trails, in my opinion.

Link to comment
Share on other sites

Wingnut,

When I have been going down new paths here as well as other places, I have learned to expect that I do not get replies.  I never wait for a reply, just keep on going.  I usually end up replying to myself.  Have been using this as a way of making notes to myself, so I can refer to log files, etc without having to keep everything.

 

Wish I could change the name of this topic for future though.  I got uvs from the variable name that David gave it in the original exporter.  It is meant to convey UV's.  

 

I actually know a lot about textures, but from OpenCL.  There I used them as database tables / indexes.  Each texel represented open-high-low-close of a stock instead of red-green-blue-alpha.

 

Jeff

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...