View topic - UV mapping a cardboard box

UV mapping a cardboard box

Post here questions about using YafaRay materials, texturing and procedural models.

UV mapping a cardboard box

Post Sat May 21, 2011 3:09 pm

allan_james wrote:@stoneage

One thing that I really want to know is how you to a good UV maping for your texture if you can give us an example like the one _Mo_ gave which by the way is yours :) I will be very happy

Thanks in advanced

http://www.yafaray.org/community/forum/ ... d444963973 Post #9

I thought I better start a new thread for this so as not to take STart's wip thread off topic.

I first modelled a template based on the broken open box, and saved the UV map 'project from view'. Then, so long as I don't change the distance between loops or add new loops the UV coordinates will hold however I manipulate the mesh. With the UV coordinates set you can edit and update the UV image 'in place'.
Screenshot-5.png



The next thing to do is fold up the model along the box edges.
Screenshot-7.png

Screenshot-9.png


With that done I used a lattice modifier to subtly distort the mesh. The lattice modifier is ideal for this as the deformation is non destructive and remains editable.

I guess this method is somewhat wasteful in terms of geometry, but it gives a very versatile end result as the model can be reused, and 'posed', in many different ways.

I think this is one of my favourites - 3D fog, depth of field and some colour correction -
OpenBox_00000-pp.png
User avatar
stoneage
 
Posts: 1241
Joined: Sun Dec 23, 2007 1:06 pm

Re: UV mapping a cardboard box

Post Mon May 23, 2011 1:24 pm

Thank you Stoneage. Can you share a scene at least with one box. Thank you !!!
User avatar
Samo
 
Posts: 3093
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: UV mapping a cardboard box

Post Wed May 25, 2011 7:56 pm

Sure thing.

Here is the whole scene. If you want to add it to the Yafaray example files I am ok with that.

I originally rendered the scene from Blender 2.49, so I have quickly set it up to render from 2.57 as well, with a borrowed and adapted compositing node set up from sadaj(http://www.mediafire.com/?mkcttp5d3dtciz0). I also changed the lighting for the 2.57 render, so the two will not be identical, though again, not to make improvements, but rather to get it done quickly, so feel free to play with it. :)

Both .blend files plus textures are included in the .7zip(8 MB):-
http://dl.dropbox.com/u/1934813/Pan-F.7z
http://dl.dropbox.com/u/1934813/Pan-F_2.65.0.7z

The settings could do with some further refinement, but I really have to get on with some other work. If anyone wants to post up improvements please do :D

PanF_2-57-02.png
Blender 2.57 + compositing nodes
Last edited by stoneage on Mon Jan 07, 2013 7:30 pm, edited 1 time in total.
User avatar
stoneage
 
Posts: 1241
Joined: Sun Dec 23, 2007 1:06 pm

Re: UV mapping a cardboard box

Post Wed May 25, 2011 8:49 pm

thank you for sharing
User avatar
STart
 
Posts: 275
Joined: Mon Apr 20, 2009 1:37 pm

Re: UV mapping a cardboard box

Post Wed May 25, 2011 9:47 pm

Thanks for the scene :D
User avatar
Samo
 
Posts: 3093
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: UV mapping a cardboard box

Post Sat Jan 07, 2012 3:29 pm

good tut.
thy for the work.
pyrit
 
Posts: 2
Joined: Thu Jan 05, 2012 3:14 pm

Re: UV mapping a cardboard box

Post Thu Jan 03, 2013 6:25 pm

Stoneage, can you please adapt this scene to Blender 2.65a, with color management enabled? thank you in advance.
User avatar
Samo
 
Posts: 3093
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: UV mapping a cardboard box

Post Thu Jan 03, 2013 10:06 pm

Sure thing, I'll take care of that this weekend. I have a couple of minor issues with it though. The hdr image I used for the environment lighting is LatLong and yafaray now provides only reflection but no illumination for sphere maps. Set to angular it does give illumination though.

The other problem is in 2.65.5 the Yafaray ui has lost the section to add and choose material and texture types. Hopefully it is a minor coding change. :)

material-01.jpg
material-01.jpg (26.69 KiB) Viewed 20752 times
material-02.jpg
material-02.jpg (27.35 KiB) Viewed 20752 times


texture-01.jpg
texture-01.jpg (26.02 KiB) Viewed 20752 times
texture-02.jpg
texture-02.jpg (26.95 KiB) Viewed 20752 times


The terminal errors:-
Traceback (most recent call last):
File "/home/organic/blender/build/bin/2.65/scripts/addons/yafaray/ui/properties_yaf_texture.py", line 80, in draw
row.template_list(idblock, "texture_slots", idblock, "active_texture_index", rows=2)
TypeError: UILayout.template_list(): error with argument 1, "listtype_name" - Function.listtype_name expected a string type, not Material


Traceback (most recent call last):
File "/home/organic/blender/build/bin/2.65/scripts/addons/yafaray/ui/properties_yaf_material.py", line 64, in draw
row.template_list(ob, "material_slots", ob, "active_material_index", rows=2)
TypeError: UILayout.template_list(): error with argument 1, "listtype_name" - Function.listtype_name expected a string type, not Object
User avatar
stoneage
 
Posts: 1241
Joined: Sun Dec 23, 2007 1:06 pm

Re: UV mapping a cardboard box

Post Thu Jan 03, 2013 11:59 pm

I'll try to do something about it ..
But .. You could use the version 2.65a Official Release?

Greetings..
povmaniac
 
Posts: 173
Joined: Wed Dec 12, 2012 10:01 am

Re: UV mapping a cardboard box

Post Fri Jan 04, 2013 12:39 am

povmaniac wrote:I'll try to do something about it ..

Thanks, that would be great. :)

povmaniac wrote:But .. You could use the version 2.65a Official Release?

Yes indeed, I'm rendering just now with 2.65.3 (I tested with 2.65.0 as well, but you know what these Blender users are like; someone's bound to load up an svn build sooner or later :)).

Here's how it looks so far:-

PanF_2-65.png


I'll try to finish it over the weekend. :)
User avatar
stoneage
 
Posts: 1241
Joined: Sun Dec 23, 2007 1:06 pm

Re: UV mapping a cardboard box

Post Fri Jan 04, 2013 10:03 am

Ok..
'template_list' has change in the last commits.
Before in properties_yaf_material.py, line 64:
row.template_list(ob, "material_slots", ob, "active_material_index", rows=2)

Now:
row.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=2)

Same change in properties_yaf_texture.py, line 80:
row.template_list("TEXTURE_UL_texslots", "", idblock, "texture_slots", idblock, "active_texture_index", rows=2)

Warning!! This change is only for Blender versions belong 2.65.3!!

Make this changes, the exporter work fine.. atm!!
Greetings..
Last edited by povmaniac on Fri Jan 04, 2013 10:04 am, edited 1 time in total.
povmaniac
 
Posts: 173
Joined: Wed Dec 12, 2012 10:01 am

Re: UV mapping a cardboard box

Post Fri Jan 04, 2013 10:04 am

can you work with Blender official release please? thanks
User avatar
Samo
 
Posts: 3093
Joined: Tue Dec 20, 2005 10:39 am
Location: Spain

Re: UV mapping a cardboard box

Post Fri Jan 04, 2013 8:06 pm

povmaniac wrote:'template_list' has change in the last commits.
Before in properties_yaf_material.py, line 64:
row.template_list(ob, "material_slots", ob, "active_material_index", rows=2)

Now:
row.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=2)

Same change in properties_yaf_texture.py, line 80:
row.template_list("TEXTURE_UL_texslots", "", idblock, "texture_slots", idblock, "active_texture_index", rows=2)


Thanks :)
I find that works for 2.65.5, but there is a problem with image textures:-
Traceback (most recent call last):
File "/home/organic/blender/build/bin/2.65/scripts/addons/yafaray/io/yaf_export.py", line 319, in update
self.exportScene()
File "/home/organic/blender/build/bin/2.65/scripts/addons/yafaray/io/yaf_export.py", line 69, in exportScene
self.exportTexture(obj)
File "/home/organic/blender/build/bin/2.65/scripts/addons/yafaray/io/yaf_export.py", line 98, in exportTexture
self.yaf_texture.writeTexture(self.scene, tex.texture)
File "/home/organic/blender/build/bin/2.65/scripts/addons/yafaray/io/yaf_texture.py", line 314, in writeTexture
yi.paramsSetBool("use_alpha", tex.use_alpha)
AttributeError: 'ImageTexture' object has no attribute 'use_alpha'



Samo wrote:can you work with Blender official release please? thanks
ok, will do.


.
User avatar
stoneage
 
Posts: 1241
Joined: Sun Dec 23, 2007 1:06 pm

Re: UV mapping a cardboard box

Post Fri Jan 04, 2013 8:55 pm

povmaniac wrote:Ok..
'template_list' has change in the last commits.
Before in properties_yaf_material.py, line 64:
row.template_list(ob, "material_slots", ob, "active_material_index", rows=2)

Now:
row.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=2)

Same change in properties_yaf_texture.py, line 80:
row.template_list("TEXTURE_UL_texslots", "", idblock, "texture_slots", idblock, "active_texture_index", rows=2)

Warning!! This change is only for Blender versions belong 2.65.3!!

Make this changes, the exporter work fine.. atm!!
Greetings..


works perfect!... thanks. Now this should go to the git repo ;)

"Power tends to corrupt, and absolute power corrupts absolutely. Great men are almost always bad men."

User avatar
condar
 
Posts: 771
Joined: Sun Apr 12, 2009 2:41 am

Re: UV mapping a cardboard box

Post Fri Jan 04, 2013 9:29 pm

I should add that Image properties don't work anymore with the exporter... I still don't know which revision made the changes but my previous try was with r53470 and up

Right now adding a texture to the scene makes Yafaray stop and that make fail the preview for any material with textures too

Code: Select all
INFO: Exporter: Creating Texture: 'Texture' type IMAGE: .../textures/Ciemny dab.jpg
INFO: Interface: Deleting scene...
INFO: Interface: Deleting environment...
INFO: Interface: Done.


AttributeError: 'ImageTexture' object has no attribute 'use_alpha'

location: <unknown location>:-1

location: <unknown location>:-1
Traceback (most recent call last):
  File ".../blender26X_svn/2.65/scripts/addons/yafaray/io/yaf_export.py", line 319, in update
    self.exportScene()
  File ".../blender26X_svn/2.65/scripts/addons/yafaray/io/yaf_export.py", line 69, in exportScene
    self.exportTexture(obj)
  File ".../blender26X_svn/2.65/scripts/addons/yafaray/io/yaf_export.py", line 98, in exportTexture
    self.yaf_texture.writeTexture(self.scene, tex.texture)
  File ".../blender26X_svn/2.65/scripts/addons/yafaray/io/yaf_texture.py", line 314, in writeTexture
    yi.paramsSetBool("use_alpha", tex.use_alpha)
AttributeError: 'ImageTexture' object has no attribute 'use_alpha'

location: <unknown location>:-1

location: <unknown location>:-1

ERROR: Environment: Specify a Camera!!
INFO: Interface: Cleaning environment...
INFO: Interface: Deleteing scene...
INFO: Interface: Clearing film and parameter maps scene...

"Power tends to corrupt, and absolute power corrupts absolutely. Great men are almost always bad men."

User avatar
condar
 
Posts: 771
Joined: Sun Apr 12, 2009 2:41 am

Next

Return to Materials and Texturing



Who is online

Users browsing this forum: No registered users and 5 guests

cron