Commit Graph

81 Commits

Author SHA1 Message Date
57f376e946 Cleanup: trailing space 2017-03-19 12:49:18 +11:00
a746a84f8a Fix T50453: Add option to OBJ export to apply render or preview modifiers. 2017-01-17 12:31:58 +01:00
afde50f681 Fix T49865: export .obj broke UVs.
This reverts rBAc553d7c0eb002a02e7, not actually sure why this change in
precision of actually written value was done.
2016-10-30 12:44:38 +01:00
1fc1a20993 Fix T49338: Export to OBJ add extra space to the texture file name on MTL file 2016-09-13 12:26:18 +02:00
c553d7c0eb Avoid writing redundant zeros
These values are always rounded to 4 decimal places so no need to write 6.
2016-04-05 18:07:04 +10:00
4355471ae8 Fix T47299: Error writing MTL options 2016-02-02 22:01:03 +11:00
c0a273d1e7 Fix T47053: Problem while import/export of obj files.
Missing import of Vector...
2015-12-23 19:58:40 +01:00
f0fe54fcdd Fix T47010: Blender OBJ UV's give issues with some apps
Blender was sharing UV's for all vertices,
while this is correct it was causing issues for Maya, 3ds Max & Unfold3D.
2015-12-22 01:11:41 +11:00
91df04dea5 Remove unused operator argument 2015-11-08 01:29:40 +11:00
ecdc7c03ec OBJ IO: add (limited) support for options of textures in MTL files.
This commit adds IO support for:
* -o (offset texture)
* -s (scale texture)
* -bm (bump multiplier, used a normal factor)

Note that it also fixes T46459.
2015-10-13 12:41:25 +02:00
626d6e8807 Fix T46437: Dupli objects should also export themselves, not only their duplis...
To be backported, should we need an 'a' release.
2015-10-10 17:20:32 +02:00
94c9c4ee33 Fix T45766: Exported OBJ/MTL files do not include emissive lighting parameters.
ke/map_ke are not official .mtl specs, but seem to be rather common extension.
map_ke was added three years ago to exporter only, this commit finishes the work
by adding ke/map_ke to importer, and ke to exporter.

NOTES:
* mtl ke is a color, while in Blender emit is only a factor, using diffuse color.
  this implies there is some loss of data during import here.
* I do not have the slightest idea about the range for ke values, so for now assuming
  a direct matching of Blender's emit value.
2015-08-13 12:04:04 +02:00
3cc970eaf5 OBJ IO: add some progress report for user.
Use new 'progress_report' util module to do both a (basic) report of I/O progression,
together with some logging/timing of main steps.

We could probably go much further, but for now it will do.

Also, using files as context manager, too!
2015-07-11 16:45:54 +02:00
7194d2205e Fix T45403: Error on OBJ export.
Own mistake in recent corrections in regarding material's ambient handling.

Also, took the oportunity to fix a bit how shadings modes are handled (previously
if read early, they could be overwritten by other later settings...).
2015-07-11 00:25:55 +02:00
3430fbc701 Fix T45316: Obj loading/saving brightness inconsistency.
Fixes:
* Wrong (off-by-one) import of specular hardness (aka specular exponent in OBJ).
* Bad usage of world color when exporting ambient color (though it seems to make sense
  on first look, this is bad because impossible to 'undo' on import - merging
  data external to object itself).
* Bad default values for diff/spec intensity in imported materials (OBJ does not
  have those, so we must assume they are 1.0).

Thanks to Luke Brookes (propuke) for finding all those glitches! :)
2015-07-05 17:20:53 +02:00
bd9fa80543 Fix T43487: Wavefront OBJ exporter should export more precise illum value in MTL file.
Was a TODO actually, now we try to match better illum values with current mesh material.
Also, using mirror color as Ka instead of ambient one, when mirror is enabled in blen mat.
2015-04-24 16:06:33 +02:00
0225bffb98 OBJ IO: More cleanup (mostly from pep8). 2015-03-01 10:45:45 +01:00
7af50e62d3 OBJ import/export cleanup.
Reviewers: mont29

Projects: #import_export

Differential Revision: https://developer.blender.org/D1151
2015-03-01 10:27:53 +01:00
887fad6a01 Fix T39879: extra UV seams where meshes overlap.
This is not a bug, in fact, but imho we do not need to compare exactness of values
up to the 6th decimal, 4th decimal should be enough, and will avoid such cases of
"over generation" of data...
2014-05-11 22:01:41 +02:00
fa5cbcd02b Fix T39487: Index Of Refraction when export to obj
Patch by Zer0 (vince), many thanks! :)
2014-03-28 18:11:50 +01:00
7af67ead20 reduce dict lookups for uv and normal export 2013-10-05 03:11:59 +00:00
dff0d9cd6d Fix [#36848] .obj exporter messes objects normals
(Hopefully!) Logic behind normals export indices was indeed wrong when using several objects (at least, not matching vertex/uv ones).
2013-09-29 07:47:11 +00:00
18a9f89287 OBJ export: export split normals when "Include Normals" is checked (help keep sharp edges...). 2013-09-13 12:04:40 +00:00
f0986beef3 Update to OBJ exporter: now you can choose wether to export smooth groups IDs as simple values or as bitflags. 2013-09-02 18:34:31 +00:00
956f1792ec fix [#36432] Exporting obj with normalmap creates opacity map in the mtl file instead
- r3954/patch [#32914], introduced incorrect displacement map name, corrected.
- added support for reading displacement maps.
- remove checks that added alpha support for diffuce images, OBJ has alpha material settings for this.
2013-08-21 08:21:01 +00:00
62e312690a add support for writing smooth groups for OBJ 2013-06-14 10:48:48 +00:00
e7e74d4d63 correct exporing of loose edges, obj spec defines faces as needing at least 3 verts (even though 2 vertex faces are in fact quite common).
now export these as lines.
2013-06-14 05:15:39 +00:00
c2f763d33a attempted quick fix was quick bug. 2013-05-15 14:06:34 +00:00
987058497d fix possible error referencing unknown var 2013-05-15 13:07:53 +00:00
2d048308c6 remove use of ob.update_from_editmode() since editmode meshes don't get access to customdata layers. 2013-03-24 19:47:31 +00:00
c75f170adb use object.update_from_editmode() for scripts which read object data. 2013-03-21 14:55:28 +00:00
3b3ee36a1d add check for 'None' textures 2013-02-15 10:46:36 +00:00
d7407794f2 skip calculating tessfaces for export. they are not needed. 2013-02-10 14:51:42 +00:00
0ee8c1bb20 fix for UV export 2013-02-10 14:16:30 +00:00
8c2a9a541c triangulate works again 2013-02-10 12:58:02 +00:00
d22b2014a2 OBJ now exports blenders ngons. 2013-02-10 12:55:10 +00:00
9e11509b70 make option for applying modifiers consistent 2013-02-07 04:25:53 +00:00
add213786e revert r4031, the user was incorrect about the bug. 2012-12-12 10:28:12 +00:00
9ef28b56eb fix [#33453] OBJ Export, "d" Value is Invalid in ".mtl" File 2012-12-09 10:51:27 +00:00
23ead6420a fix for exporting OBJ files without a material - would get blank 'newmtl' ID's 2012-12-04 01:08:18 +00:00
d201939c63 fix regression in OBJ export 2012-12-03 12:28:07 +00:00
24cebd7bed patch [#32914] wavefront (.obj) export
from dan grauer (kromar)

With change use_map_color_emission (which is for volumetrics only) to use_map_emit.

also ignore generated face-images (which have no file path).
2012-11-12 02:03:34 +00:00
55fc672999 fix [#33086] Empty vertex group causes list index out of range error on export OBJ 2012-11-05 05:59:33 +00:00
c07f1b9a94 Fix for [#32102] Saving obj extends the material name by texture name
Changed how mtl_mat names are generated, so that we can still be sure to always have a unique mtl_name for each key (mat_name, tex_name), yet avoiding to add tex name to mat when not needed.
2012-07-15 14:23:58 +00:00
7f1754c791 Spellfixes: colour -> color 2012-07-04 12:20:09 +00:00
2dc06f6d50 Style edit (mostly), use """ for docstrings (not '''). 2012-07-03 09:01:43 +00:00
600104361b Fix [#31039] Obj export adds blendfile name to the texture names (and [31040] too).
bpy_extras.io_utils.path_reference() expects a real dir as base_src, not the blend file name!
2012-04-20 19:45:05 +00:00
e63e95789e update addons enabled by default to use 'faces -> tessfaces' also grease pencil scatter and quake map export. 2012-03-23 01:18:52 +00:00
f463003c6a update obj import/export for BMesh api changes. (should now works as expected) 2012-03-07 22:00:35 +00:00
27a5698154 patch [#29490] OBJ exporter with "write materrials" unchecked write a line "usemtl"
from ed gautier (edddy)
2011-12-04 07:53:18 +00:00