Commit Graph

179 Commits

Author SHA1 Message Date
7306eb84f0 move NavMesh draw code out of being a modifier and into DerivedMesh drawing hack (which IMHO is less bad then mis-using a modifier only to override drawing calls). 2011-10-09 21:11:51 +00:00
13dfd82997 changes for materials to treat them as shorts not int/chars (since they are stored as shorts intermally)
- converting nurbs to mesh was casting the material to unsigned char.
- subsurf was casting to char, then int -> short in a loop.
- have material functions take & return shorts.
2011-09-20 06:25:15 +00:00
Dalai Felinto
432bd158fb bugfix [#28111] material.pop breaks mt->mat_nr
create a new parameter for materials.pop() to not remove material slot.
this way the mat_nr is still the old one.

for the default behaviour we now have material remapping (i.e. data_delete_material_index_id(id, index)).
This new function is brought from the material_slot remove function.
2011-07-31 11:12:38 +00:00
e4cc1c3f2c fix [#27178] Material links lost when making mesh data local
- making local object data - Curve/Mesh/MBall lost references to linked materials.
- joining a linked mesh object into a local one lost the link.

As well as these reported bugs, checked all local functions for consistency/correctness and found other cases which would also fail.
- making local metaball didn't ensure unique ID name.
- make_local_armature() was missing check for object users - main body of code would never run.
- local particles didn't set the dupli-group or textures to extern.

checked all local functions for consistency/correctness.
2011-04-26 07:17:21 +00:00
210ee1ade4 whitespace only, no functional change mixed tabs/spaces --> tabs. 2011-04-21 13:11:51 +00:00
62a02764ab fix [#27096] Segmentation Fault trying to export DirectX with specific model
copying a mesh in editmode didnt NULL the edit_mesh pointer.
2011-04-21 09:03:04 +00:00
d3e4c2243d correct typo 2011-04-14 22:15:43 +00:00
709e4b309e Revert mesh recalculation change that gives different vertex normals based
on smooth/flat flag on faces. This does give better results for low poly
game models, but there's just too much functionality that depends on this
(modifiers, displacey, editmode tools, extrude, ...), that there's not
enough time to fix these before the release.
2011-04-04 13:02:12 +00:00
d40b0dfb75 Comments for mesh normals calculation from Mortem Mikkelsen (aka sparky).
We hope it'll help for further workers in this area!
2011-04-01 18:35:49 +00:00
dd56ebe607 blenkernel: floats were being implicitly promoted to doubles, adjust to use floats. 2011-03-28 04:22:50 +00:00
ac1cb5ee05 - quiet new warnings with gcc 4.6
- use BLI math funcs for normal float/short conversion.
- correct some un-intentional float/double promotions.
2011-03-28 02:34:55 +00:00
121075ec15 One more fix for recent normals re-calculation change 2011-03-26 17:43:07 +00:00
5aec085da0 Fixed memory access in mesh_calc_normals(). Now it uses much less memory. 2011-03-26 09:48:03 +00:00
63e40dbe0e Fix #26582, #26586, #26613: recent normal calculation changes didn't take
into account that some tools use normals for things other than display. Now
we properly initialize vertex normals at flat faces too.

Also fixed a normal refresh issue, and deduplicated CDDM/mesh normal
calculation code.
2011-03-26 08:28:24 +00:00
549b5e1222 Fix/change in normal computation, now the viewport uses the same angle
weighted normals as the render engine, and the render engine will copy
normals from the mesh rather than always recalculating them.

Subsurf/multires still use regular vertex normals, but they are expected
to be sufficiently high resolution to not need this.

This means that normal maps displayed in the viewport actually match the
render engine exactly and don't have artifacts due to this discrepancy.
It of course also avoids unexpected surprises where your render normals
look different than your viewport normals.

Subversion bumped to 4 for version patch to recalculate normals.

Patch by Morten Mikkelsen, with some small changes.
2011-03-20 13:35:35 +00:00
Nathan Letwory
0ff06e21cd doxygen: blender/blenkernel tagged. 2011-02-27 20:40:57 +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
7f5dbb7de0 Fix #26040: Crash converting curve to mesh
Really stupid mistake :)
2011-02-11 17:43:56 +00:00
264c8c2162 mesh.validate() now returns True if any corrections were made.
tested that correcting invalid meshes works by generating random meshes and checking that only the first call to mesh.validate() makes changes.

found 2 bugs in mesh validation.
- face sorting array wasn't assigned correct indices.
- removing invalid edges used wrong comparison.
2011-02-10 09:29:31 +00:00
97c57abfa3 fix [#25994] Meshes with no vertices gets NaN location on setting origin to geometry 2011-02-09 15:32:39 +00:00
5aa72b8726 BKE_mesh_validate() now corrects invalid meshes (optionally), added access for python so it can correct for bad imported geometry - mesh.validate(). 2011-02-09 15:13:20 +00:00
0884147698 fix [#25968] Crash on changing merge distance in array modifier with edgesplit modifier in chain 2011-02-09 04:45:53 +00:00
f6733d90e5 bugfix [#25523] Face extrude will crash Blender if array and subsurf modifier are added to mesh object
test_index_face() failed to fix indices like (6,0,0,6), making it (0,6,6,0).
2011-02-09 03:49:59 +00:00
89c9aaaa25 remove references to BKE_utildefines where its not needed.
- move GS() define into DNA_ID.h
- add BLI_utildefines as an automatic include with makesrna generated files.
2011-01-07 19:18:31 +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
64c3ea272e Todo item: linked curve objects behaves incorrect with modifiers
Use object's displists for storing deformed tesselated curve. Was unable to
totally get rid of curve's displist because of how texture space is calculating.
2011-01-05 10:40:38 +00:00
b110c7c8f2 Dependency graph: changed DAG_id_flush_update to DAG_id_tag_update. Now it
only tags the ID and does the actual flush/update delayed, before the next
redraw. For objects the update was already delayed, just flushing wasn't
yet.

This should help performance in python and animation editors, by making 
calls to RNA property update quicker. Still need to add calls in a few
places where this was previously avoided due to bad performance.
2010-12-05 18:59:23 +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
a1c7cccae4 Fix bug with unneeded outline for filled 2d curves when converted to mesh
- Revert of my old change in curve->mesh conversion
- Do not ignore DL_POLYs for surfaces -- they will never be filled,
  but ignore them for 2d curves -- they'll be filled with INDEX3 parts.
2010-11-06 06:22:25 +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
Nathan Letwory
6e2e7c00c1 fix potential crasher: malloc->calloc 2010-10-14 10:34:04 +00:00
9b7cc91134 bugfix [#22169] LoopCut and Slide plus ArrayModifier Object offset FirstLast gives crash 2010-09-23 14:29:51 +00:00
916085247a Fix #23925: converting text into a curve looses materials
filldisplist worked incorrect with polys when charidx matched but col doesn't
Also fixed material loose when converting text/curve to mesh
2010-09-22 05:08:52 +00:00
4eaa10aa02 == Multires ==
Fixed bug #23657, "Modifiers dosen't work when you select diffrent mesh for object"

Multires modifier now adds empty mdisps if they're missing, rather than displaying a warning
Switching an object's mesh will now check for a multires modifier; if found the modifier's total number of levels are reset to match the mesh's mdisps
Switching the mesh also forces a multires update so that sculpted changes aren't lost
2010-09-09 00:14:51 +00:00
728b713d86 use more BLI math functions. 2010-08-15 15:14:08 +00:00
0738ae7688 2.5: more removal of G.main. 2010-08-13 14:23:44 +00:00
66f32bd7f9 set origin was setting surfaces as 2D curves, added dupli-group support using the dupli's offset value. 2010-08-03 00:56:43 +00:00
d25747ee75 bugfix's
[#23108] bpy.ops.object.origin_set(type='GEOMETRY_ORIGIN') dosen't work in console
  [#23115] Crash when moving armature origin

- setting the armature in editmode would leave editdata in some cases.
- transforming selected linked objects to account for the movement of the obdata was only done for meshes, now do for curves and text3d.
- added utility functions for getting curve & mesh bounds.
- text3d moving center wasn't working at all.
- changed drawobject.c to use BLI_math funcs in more places.
- remove some unused code from operator object.origin_set.
2010-08-01 11:00:36 +00:00
5251a9b3bf 2.5: remove vertex normal flip option, this is more harmful than helpful
in many cases, and also gave incorrect rim lighting.
2010-07-30 11:50:00 +00:00
d200243a5c Fix #22654: Converted curve from mesh disappearing
Curve object should have ob->bb=NULL if there is no derivedMesh
2010-06-23 09:58:02 +00:00
fba7ebcbea replace add_v3_v3v3() --> add_v3_v3() where possible 2010-04-21 12:27:48 +00:00
8f1500da00 remove config.h references, was added for automake build system rev around 124-126 but isnt used by any build systems now. 2010-04-18 10:28:37 +00:00
694934a2f7 Fix #21850: Modifier applied to surface doesnt work when only a curve.
I removed 3D flag checking for DL_POLY displists in nurbs-to-mesh conversion
function -- DL_POLY displist should be always converted to edge loop.
DL_POLY which should be converted to something else is odd i think.

This commit also fixes trouble cyclic surface curve to mesh conversion problem.
2010-04-04 11:07:34 +00:00
5f070227ac trick to give correct normals for cyclic curves used with the screw modifier. 2010-03-30 22:43:43 +00:00
1e9bf0cfdb spaces -> tabs, (4 spaces == 1 tab, only for white space preceding text) 2010-03-22 09:30:00 +00:00
546ca400d8 removed unused includes, except for physics and particle related files 2010-03-21 13:42:25 +00:00
391cc2d004 merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
94d06bf3d4 Fix #21594: converting bevel objects to mesh stops displaying them in spacial cases
Mesh's boundbox should be re-calculated after curve->mesh conversion.
To avoid troubles with displaying texture space i've used
tex_space_mesh() for this.
2010-03-14 12:12:21 +00:00
838842581c - Fixed trouble with rendering curves with disabled modifiers, which are
disabled for realtime displaying but enabled for rendering.
- Calculate tex space for curves before modifiers applying.
2010-03-08 13:49:13 +00:00
3ad1bfa69e Fix for convert_exec()
"Keep original" option now works for all objects' types
2010-03-07 05:04:22 +00:00