Commit Graph

107 Commits

Author SHA1 Message Date
21eb8b92a0 use newly added ID_BLEND_PATH() in more places. 2011-10-08 11:11:54 +00:00
Dalai Felinto
b263aefb0e TexFace to Material Settings big patch
Summary:
========
The idea here is to move the texface options into the material panel.
For images with the change please visit:
http://code.blender.org/index.php/2011/09/bge-material-texface-changes

1 - Some of the legacy problems 2.49 and 2.5x has with the texface system:
==========================================================================
1.1) Shadow, Bilboard and Halo are mutual exclusive (in the code), yet you can
select a face to be more than one mode.
1.2) Sort only works for blend Alpha yet it's an option regardless of the
Transparency Blend you pick.
1.3) Shared doesn't affect anything in BGE.
1.4) ObColor only works for Text objects (old bitmap texts) when using Texture
Face Materials. (not address yet, I so far ignored obcolor)

2 - Notes:
============
2.1) Now "Use Face Textures" in material Option panel will work in Multitexture
even if there is no texture channel.

2.2) In FaceTexture mode it will use TexFace all the time, even if you don't
check the "Use Texture Face" option in the UI. It's a matter of decision, since
the code for either way is there. I decided by the solution that makes the
creation of a material fast - in this mode the user doesn't need to mess with
textures or this "Use Texture Face" option at all. I'm not strong in my opinion
here. But I think if we don't have this then what is the point of the Texture
Face mode?

2.3) I kept references for tface only when we need the image, UV or the tiling
setting. It should help later when/if we split the Image and UV layers from the
tface struct  (Campbell and Brecht proposal).

3 - Changes in a Nutshell:
==========================
3.1) "Texture Face" panel (in the Mesh/Object Data panel) no longer exists. Those settings are all part of the material properties, visible when Game Render is set.

3.2) "Texture Face" Shading mode (in the Render panel) is now called “Single Texture”, it needs a material for special settings (e.g. Billboard, Alpha Sort, …).

3.3) New options in the Material Panel
* Shadeless option in the Material panel is now supported for all three Shading modes.
* Physics is now toggleable, this is the old Collision option.
* Two Side (on) is now called Back Culling (off).
* Alpha Sort is one of the Alpha options, together (and mutually exclusive) to Alpha Blend, Alpha Clip, Add and Opaque (i.e. solid).
* Shadow, Billboard and Halo are grouped in the “Face Orientation” property.
* "Face Textures" and "Face Textures Alpha" (under Options) can be used for all but GLSL shading mode (to be supported in GLSL eventually).
* The backend in the game engine is still the same as before. The only changes are in the interface and in the way you need to think your materials. The bottomline is: It’s no longer possible to share materials between faces that do not share the same game properties.

4 - Acknowledgment:
==================
Mike Pan for the design discussions, and testing along the whole development process.
Vitor Balbio for the first hands-on code with the interface changes. That helped me a lot to push me into work on that.
Benoit Bolsee and Brecht van Lommel for patch review (* no one reviewed the whole patch, or the latest iteractions, so I still hold liability for any problems).
Blender artists that gave feedback and helped testing the patch.

Patch review and original documentation can be found here:
http://wiki.blender.org/index.php/User:Dfelinto/TexFace
http://codereview.appspot.com/4289041/
2011-09-19 19:55:59 +00:00
dbd6658d73 svn merge -r 37306:39975 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-09-07 15:34:04 +00:00
a6a14d0a1e == CustomData ==
* Added comments for each entry in the LAYERTYPEINFO array noting the
  number and name of the layer type; was hard to tell before which
  entry was what
2011-09-03 08:18:43 +00:00
6c3bb8b903 EditMesh-based skin node drawing 2011-07-31 02:03:48 +00:00
cff57b14a1 Imported bsphere.c, mostly ifdef'd out for now 2011-07-31 02:03:39 +00:00
601eb68420 Added SkinNode DNA and customdata. 2011-07-31 02:03:21 +00:00
3b6cb504b1 minor warning fixes for clang-static-checker 2011-07-27 13:03:56 +00:00
b5bd86e590 svn merge -r 37212:37306 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-06-07 21:20:25 +00:00
a1c22262fe Bake from multires mesh
=======================

Added option to baked named "Bake From Multires" which is avaliable for
normals baking and displacement baking.

If this option is enabled, then no additional hi-res meshes and render
structures would be created . This saves plenty of memory and meshes
with millions of faces could be successfully baked in few minutes.

Baking happens from highest level against viewport subdivision level,
so workflow is following:
  - Set viewport level to level at which texture would be applied
    during final rendering.
  - Choose Displacement/Normals baking.
  - Enable "Bake From Multires" option.
  - You're ready to bake.

Displacement baker had aditional option named "Low Resolution Mesh".
This option is used to set if you want texture for realtime (games)
usage.

Internally it does the following:
  - If it's disabled, displacement is calculated from subdivided
    viewport level, so texture looks "smooth" (it's how default
    baked works).
  - If it's enabled, dispalcement is calculated against unsubdivided
    viewport levels. This leads to "scales". This isn;t useful for
    offline renders much, but very useful for creating game textures.

Special thanks to Morten Mikkelsen (aka sparky) for all mathematics
and other work he've done fr this patch!
2011-06-05 20:54:04 +00:00
Nick Samarin
a918040902 synched with trunk at revision 36569 2011-05-16 20:30:59 +00:00
e9005b985e remove some redundant vars, assignments & checks. 2011-03-19 05:06:06 +00:00
Nathan Letwory
0ff06e21cd doxygen: blender/blenkernel tagged. 2011-02-27 20:40:57 +00:00
Nick Samarin
c5f6a01dd5 synched with trunk at revision 34793 2011-02-16 17:07:18 +00:00
20553d4064 This commit will switch blender to use tangent space generated within
the two files mikktspace.h and mikktspace.c. These are standalone files
which can be redistributed into any other application and regenerate the
same tangent spaces. The implementation is independent of the ordering
of faces and the vertex ordering of faces.
2011-02-14 18:18:46 +00:00
0955c664aa fix for warnings from Sparse static source code checker, mostly BKE/BLI and python functions.
- use NULL rather then 0 where possible (makes code & function calls more readable IMHO).
- set static variables and functions (exposed some unused vars/funcs).
- use func(void) rather then func() for definitions.
2011-02-13 10:52:18 +00:00
9e9e028f05 access past array bounds in layerInterp_mdisps, also make some vars const. 2011-02-12 10:18:21 +00:00
8227b3d463 remove/comment unused vars
also removed unnecessary NULL checks (where the pointer was used later without checking).
2011-01-13 04:53:55 +00:00
37b903e32c Fix #25594: Adding mesh while in edit mode with multires - crash.
That primitives, which used ri crash blender, flips normals just after creation
and this normals flipping calls layers interpolation, but MDISPS layer
contains no data still.

Just added checking to layerInterp_mdisps.
2011-01-11 22:06:44 +00:00
8f21a43535 split BKE_utildefines.h, now it only has blender specific defines like GS() MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h.
no functional changes.
2011-01-07 18:36:47 +00:00
78162fa793 Splitting quad into triangles and merging triangles into quad should
work correct with sculpting data now.

Joining two triangles could give incorrect sculpting result for
special topologies, but it's that case that can't be nicely handled
with our layers architecture.
2011-01-02 17:38:22 +00:00
24e80665d8 New customdata layer callback: validate
Used to validate displacement allocation size after face copying
to match face vertex and displacement corners count.
2011-01-02 17:08:25 +00:00
76f0569a86 Multires math function used for layer interpolation moved from customdata.c to multires.c
No functional changes
2011-01-02 16:43:28 +00:00
c169ccc711 Silence more compiler warnings. 2010-12-31 20:01:38 +00:00
2811707b92 Fixed stupid typo with detecting corners of source mdisp.
Haven't noticed before because destination is a copy of source for now,
so there would be always the same count of corners.
2010-12-22 21:38:06 +00:00
Nathan Letwory
fad7121ca3 Apply [#25296] Fix for [#24636]
Bug reported by Dominique Lorre
Fix submitted by Jeroen Bakker

When importing COLLADA files, the name of a custom data layer can be longer than 32 bytes. Make sure only 32 bytes are copied.
2010-12-19 20:23:30 +00:00
991eac85ff Initial implementation of mdisps layer interpolation
Sculpt data shouldn't be lost when making topology changes without
quads<->tris face converison.

General idea:
- Go through all grid points of each corner and convert per-corner
  coordiante to per-face cooredinate
- Apply weights and convert new point to per-corner coordinate
- Use bilinear interpolation to get needed displacement vector

Some additional work was necessery:
- Two neighbour corners could have different displacements along common
  boundary. multires_mdisp_smooth_bounds() makes displacement "symmetrical"
- Point could change it's corner, so displacement vector should be flipped
  in some way. In some cases it's not only flipping, because corner could
  be mapped with some rotation. It's not solved for triangular faces yet,
  so only z-axis displacement would be interpolated for tris.

More limitations:
- Interpolation will give incorrect result after quad<->triangle
  face conversion.
- When face normal was fillped displacement would change it's direction too.
2010-12-13 21:22:30 +00:00
263830f000 Enabled GCC -Wwrite-strings warning for CMake and replaced many 'char's for 'const char's,.
Only one functional change where Transform orientations passed "" to BIF_createTransformOrientation() which could then have the value written into.
2010-12-03 17:05:21 +00:00
51dcbdde03 use 'const char *' by default with RNA functions except when the value is flagged as PROP_THICK_WRAP.
Also use const char in many other parts of blenders code.

Currently this gives warnings for setting operator id, label and description since these are an exception and allocated beforehand.
2010-11-17 09:45:45 +00:00
20b16e4074 de-duplicate unique naming logic, was used in 7 different places, convert into a function call. 2010-11-07 08:49:07 +00:00
f478cef43b Fix #24388: multires base mesh
- MDisp should be re-allocated if face changed amount of vertices
- Allocate disps array in layerSwap_mdisps to prevent loosing all highres data
2010-11-04 16:00:28 +00:00
daa4feaaea bugfix [#24477] Can easily create bones with duplicate names
- fixed this error 7 different functions (deform groups, uv layers & similar).
- support for numbers over 999.
- renamed splitIDname() to BLI_split_name_num(), moved to BLI_path_utils
2010-11-01 07:19:41 +00:00
Nathan Letwory
715fa82769 Make sure separation between modifier keys is communicated from GHOST upwards too (BGE at least uses this). 2010-10-24 12:45:47 +00:00
1de1d6537e Fully disable AUD's FFTW3 usage. 2010-10-24 00:09:23 +00:00
4d37cf90b9 remove G.sce, use G.main->name instead.
Both stored the filename of the blend file, but G.sce stored the last opened file.
This will make blender act differently in some cases since a relative path to the last opened file will no longer resolve (which is correct IMHO since that file isnt open and the path might not even be valid anymore).

Tested linking with durian files and rendering to relative paths when no files is loaded however we may need to have some operators give an error if they are used on the default startup.blend.
2010-10-18 06:41:16 +00:00
30b79ddcc6 - fixed remaining unused warnings.
- omit render code from this warning (cmake only), until render branch is merged.
- moved -Wunused-parameter warning to apply to all C code in blender (not just ./source/blender), (cmake only).
2010-10-17 06:38:56 +00:00
28e144db92 Fix #24139: Edge loop + Multi-Resolution modifier results weird artifacts
- mdisp_corners used to return incorrect number of verts in some cases
- fixed memory corruption when face changed vertex count in
  edit mode (forgot displacement for such faces atm, could be changed
  in the future)
2010-10-16 20:43:16 +00:00
8268a4be71 most unused arg warnings corrected.
- removed deprecated bitmap arg from IMB_allocImBuf (plugins will need updating).
- mostly tagged UNUSED() since some of these functions look like they may need to have the arguments used later.
2010-10-16 14:32:17 +00:00
Nick Samarin
90ab716cd5 synched with trunk at revision 32129 2010-10-03 16:28:28 +00:00
4ab6881617 Fix #23186: use of unitialized memory when creating new faces on a mesh
with a multires modifier.
2010-09-30 22:27:37 +00:00
f6c323aa42 - move more active properties into their collections:
scene.active_keying_set --> scene.keying_sets.active
  ...same for active_uv_texture. active_vertex_color, active_keyconfig, 

- move mesh.add_uv_layer() and mesh.add_vertex_color() into their collections
  also have them return the newly created layer and dont set the layer active.

  uvtex = mesh.uv_layers.new(name)
  vcol = mesh.vertex_colors.new(name)
2010-08-23 22:16:45 +00:00
Nick Samarin
dbc8d4274f - moved navmesh conversion code to ED_Editors project (ED_navmesh_conversion.h and navmesh_conversion.cpp files)
- added new custom data layer CD_Recast
2010-07-30 13:02:32 +00:00
9cbbc9d3af rename some rna properties filename --> filepath
* filename == "foo.ext"
 * filepath == "/path/to/and/including/foo.ext"

this was alredy followed in some places not not everywhere.
2010-06-02 17:58:28 +00:00
3961793292 Fix #22239: external btx won't load. 2010-06-01 19:26:35 +00:00
135f8be2c7 Small bug fix:
The array of string names for CD layers was missing a few. Added them back and organized a bit for clarity.
2010-05-27 08:42:59 +00:00
9bd3f08b65 Multires: fix for "failed to read" error message with external displacements. 2010-05-07 09:48:40 +00:00
70a96a1089 saving multires data didnt get the new filename when the external struct was alredy allocated (making save external fail) 2010-05-07 09:41:26 +00:00
392e1da179 bugfix and cleanup
- BGE Shader.setSampler(name, index): index range check was wrong.
- Compositor check for an invalid channel was incorrect.
- getting the center of selected verts used an uninitalized z axis.
- do_init_render_material() used && rather then & when testing for MA_TRANSP.
- weight paint activate flipped bone used && rather then & for flag checking.
2010-04-17 15:47:00 +00:00
4d2f5a275d Solidify Modifier
- vertex normals were not being flipped (though faces are)
- rim faces didnt influence edge vertex normals

apply solidify on top of solidify modifier now works correctly
2010-04-10 22:12:10 +00:00
253de0ed86 * Assign weight from bones in weight paint mode now respects paint face
mask, also avoid making vertex groups if they will not be filled.
* Add back image pin option in image editor header.
* Fix deep shadow not respecting Cast Buffer Shadows option.
* Tangent space normal map baking should work again now.
* Fix a problem with particle duplis, due to own bugfix for #20350,
  the problem for that seems to be in dupliverts, not particles.
* Fix external multires data link getting lost on exiting editmode.

(commits 27776,27777,27830,27840,27841,27862 by Brecht from render25 branch)
2010-03-30 12:01:17 +00:00