Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-08-07Refactor ID copying (and to some extent, ID freeing).Bastien Montagne
This will allow much finer controll over how we copy data-blocks, from full copy in Main database, to "lighter" ones (out of Main, inside an already allocated datablock, etc.). This commit also transfers a llot of what was previously handled by per-ID-type custom code to generic ID handling code in BKE_library. Hopefully will avoid in future inconsistencies and missing bits we had all over the codebase in the past. It also adds missing copying handling for a few types, most notably Scene (which where using a fully customized handling previously). Note that the type of allocation used during copying (regular in Main, allocated but outside of Main, or not allocated by ID handling code at all) is stored in ID's, which allows to handle them correctly when freeing. This needs to be taken care of with caution when doing 'weird' unusual things with ID copying and/or allocation! As a final note, while rather noisy, this commit will hopefully not break too much existing branches, old 'API' has been kept for the main part, as a wrapper around new code. Cleaning it up will happen later. Design task : T51804 Phab Diff: D2714
2017-07-05Code comments regarding last commit (forgotten to add before)Luca Rood
Using an arbitrary face as the source of the UV data is mostly fine, as vertices on seams will generally map to different parts of the texture that have the same color. This is regarding fed853ea782211298c902759ec8cd8e455d8b41d
2017-07-05Fix T51296: UVs not working for hair emitted from verticesLuca Rood
2017-07-03Fix T51523: Lattice modifier affecting particles even when disabledLuca Rood
Particles were ignoring the lattice modifier visibility, and "influence" property.
2017-06-14Make whole ID copying code use const source pointer.Bastien Montagne
Noisy change, but safe, and better do it sooner than later if we are to rework copying code. Also, previous commit shows this *is* useful to catch some mistakes.
2017-06-12Cleanup: indentation, long linesCampbell Barton
2017-05-20CMake: Use GCC7's -Wimplicit-fallthrough=5Campbell Barton
Use to avoid accidental missing break statements, use ATTR_FALLTHROUGH to suppress.
2017-02-07Fix missing hair after rendering with different viewport/render settingsSergey Sharybin
Derived mesh for particles did not include tessellated faces when it was expected to. Now added explicit function to copy CDDM with tess faces without need to re-tessellate the result.
2016-09-15Fix crash in some cases when deleting particle systems.Bastien Montagne
Those 'never null' ID pointers are really a PITA to handle... luckily we don't have much of those around! Found by Sybren, thanks. Should be backported to 2.78.
2016-09-08Fix T49283: Crash in BKE_ptcache_make_particle_key.Bastien Montagne
This is really hack-fix actually, not sure why `get_pointcache_keys_for_time()` seems to assume it will always find key for given part index at least for current frame, and whether this assumption is wrong or whether bug happens elsewhere... Anyway, this is to be wiped out in 2.8, so no point loosing too much time on it, for now merely returning unchanged (i.e. zero'ed) ParticleKeys in case index2 is invalid. Won't hurt anyway, even if this did not crash in release builds, would be returning giberish values.
2016-09-08Fix compilation error: Shadowing of variableSergey Sharybin
2016-09-07Fix T49273: Crash during access to dupli weights at launch time.Bastien Montagne
See commit's comments for details, but this boils down to: do not try to use purely runtime cache data as a 'real' ID pointer in readcode, it's likely doomed to fail in some cases, and is bad practice in any case! Thix fix implies dupliweight's object will be invalid until first scene update (i.e. first particles evaluation).
2016-08-26Fix T49151: ParticleSettings' usercount not decremented when removing a psys ↵Bastien Montagne
from an object.
2016-08-07Particles: don't output nonsense UV data for Grid distribution particles.Alexander Gavrilov
As reported in T48928, From Dupli UV is not supported for grid distribution, and running the normal code as usual simply produces nonsense data, because fuv is used to hold orco instead of interpolation factors for uv, and num is zero. Since support won't be added in 2.78, just stop outputting nonsense.
2016-07-25Cleanup: factorize the 'ensure local' part of datablock copy into a single ↵Bastien Montagne
BKE_id_copy_ensure_local function.
2016-07-21Refactor/deduplicate even more make_local code (and fix part of T48907).Bastien Montagne
Turns out most BKE_foo_make_local datablock-specific functions are actually doing exactly the same thing, only two currently need special additional operations (object and brush ones). So added a BKE_id_make_local_generic instead of copying same code over and over. Also, changed a bit how make_local works in case we are localizing a whole library. We need to do the 'remap' step (from old linked ID to new local one) in the second loop, otherwise we miss some dependencies. This fixes main part of T48907.
2016-07-14Add option to id_make_local to force localization of datablock, even if not ↵Bastien Montagne
used locally. Will be used by link/append code.
2016-07-11Remove usercount handling from BKE_id_expand_local.Bastien Montagne
Idea looked good, but we have too much custom situations here (some half-fake-sub-ID being copied with their 'owner', animdata, etc.), let's let datablock copy functions handle that themselves. Also allows to safely call BKE_id_expand_local from all copy functions now (only when copying linked data).
2016-07-11Cleanup: remove call to BKE_id_lib_local_paths() in make_local functions.Bastien Montagne
This one is already called by matching copy functions, no need to call it twice!
2016-07-11Use new generic BKE_id_expand_local() for both make_local() and copy() ↵Bastien Montagne
functions of actions, brushes and particles. This greatly simplifies said code, once again no change expected from user PoV.
2016-07-10Refactor/enhance BKE_particlesettings_make_local().Bastien Montagne
Now using modern features from libquery/libremap areas. Provides same kind of fixes/improvements as for BKE_object_make_local() (see rBd1a4ae3f395a6).
2016-07-10Cleanup/Refactor: pass Main pointer to all ID copy functions.Bastien Montagne
Also allows us to get rid of a few _copy_ex() versions...
2016-07-06Replace of (id->lib != NULL) check by meaningful macro.Bastien Montagne
Idea is to replace hard-to-track (id->lib != NULL) 'is linked datablock' check everywhere in Blender by a macro doing the same thing. This will allow to easily spot those checks in future, and more importantly, to easily change it (see work done in asset-engine branch). Note: did not touch to readfile.c, since there most of the time 'id->lib' check actually concerns the pointer, and not a check whether ID is linked or not. Will have a closer look at it later. Reviewers: campbellbarton, brecht, sergey Differential Revision: https://developer.blender.org/D2082
2016-06-23Fix T48658: Cycles render & render preview corrupts particlesCampbell Barton
Replaces `G.is_rendering` with `use_render_params` argument. This is needed for Cycles, which attempts to restore render-preview settings from particles, after it gets its own particle data, but fails to restore because `G.is_rendering` was being checked in psys_cache_paths (and other places).
2016-06-22ID-Remap - Step one: core work (cleanup and rework of generic ID datablock ↵Bastien Montagne
handling). This commit changes a lot of how IDs are handled internally, especially the unlinking/freeing processes. So far, this was very fuzy, to summarize cleanly deleting or replacing a datablock was pretty much impossible, except for a few special cases. Also, unlinking was handled by each datatype, in a rather messy and prone-to-errors way (quite a few ID usages were missed or wrongly handled that way). One of the main goal of id-remap branch was to cleanup this, and fatorize ID links handling by using library_query utils to allow generic handling of those, which is now the case (now, generic ID links handling is only "knwon" from readfile.c and library_query.c). This commit also adds backends to allow live replacement and deletion of datablocks in Blender (so-called 'remapping' process, where we replace all usages of a given ID pointer by a new one, or NULL one in case of unlinking). This will allow nice new features, like ability to easily reload or relocate libraries, real immediate deletion of datablocks in blender, replacement of one datablock by another, etc. Some of those are for next commits. A word of warning: this commit is highly risky, because it affects potentially a lot in Blender core. Though it was tested rather deeply, being totally impossible to check all possible ID usage cases, it's likely there are some remaining issues and bugs in new code... Please report them! ;) Review task: D2027 (https://developer.blender.org/D2027). Reviewed by campbellbarton, thanks a bunch.
2016-06-03Fix T48575: Particle crash using 'Parting' settingCampbell Barton
2016-05-17C99/C++11: replace deprecated finite() by isfinite().Brecht Van Lommel
2016-04-08Fix T48088: Reproducible crash: Edges + Array Mod + Hair Particles.Bastien Montagne
Code did not consider the possibility to have no face at all! :P
2016-03-28Fix T47972: Blender crash showing particle system.Bastien Montagne
Do same as with faces - if no orcodata is available, fill orco with current location...
2016-03-26Fix T47935: Hair particles; The display percentage parameter breaks after a ↵Bastien Montagne
render is done. Follow same logic in `psys_render_restore` as in `psys_render_set` - if hair and display percentage is not 100%, we have to recompute particles... With regular 'emitter' particles just hiding some is fine (though using random here will not give a precise proportion...).
2016-03-02Fix T47610: Texture node in compositing nodes does not updateSergey Sharybin
The issue was caused by some code accessing R from a functions which are marked as safe for use from outside of render pipeline. Now those functions are safe(er) for use.
2016-02-23Fix T47531: crash with particle roughness curve mapping, after fix for T46382.Brecht Van Lommel
2016-02-02Fix T46382: Crash sharing particle system with clump or rough curvesSergey Sharybin
Made those curves local to thread evaluation now, so there is no threading conflict accessing them from evaluation threads anymore.
2016-01-11Fix T47147: small particles incorrectly rendered as large particles ↵Bastien Montagne
(particle size influenced by texture). In fact, code would behave strangely here with any negative value, applying a 'wrapped positive clamping' (comes from original 2.5 commit feature, rBfafbd9d71b95776d1c7583476de74fccefab7f10)... This commit is conservative - it keeps same behavior for all particle properties affected by textures, except for size and length, where we apply a real [0, 1] clamping. Easy to change in future in case new odd cases popup.
2016-01-09Fix T47060: Uv form dupli not working with Cycles when the hair/particles ↵Bastien Montagne
mesh has more than one uv sets. In fact, it was not working with BI either - 'UV from dupli' would always take active UVLayer, not render_active one. Fixed now for both Cycles and BI, and for both particles and 'simple' dupli_face.
2016-01-07Cleanup: remove unused scene argCampbell Barton
2016-01-06Proper fix for memleaks when rendering partsys from edit mode...Bastien Montagne
2016-01-04Fix T47038: Particles in Particle Edit Mode get added in completely wrong ↵Bastien Montagne
location. It also fixes another issue (crash) related to symmetric editing. Quite involved, we (try to!) fix complete broken logic of parts of particle code, which would use poly index as tessface one (or vice-versa). Issue most probably goes back to BMesh integration time... This patch mostly fixes particle editing mode: - Adding/removing particles when using generative modifiers (like subsurf) should now work. - Adding/removing particles with a non-tessellated mesh (i.e. one having ngons) should also mostly work. - X-axis-mirror-editing particles over ngons does not really work, not sure why currently. - All this in both 'modes' (with or without using modifier stack for particles). Tech side: - Store a deformed-only DM in particle modifier data. - Rename existing DM to make it clear it's a final one. - Use deformed-only DM's tessface2poly mapping to 'solve' poly/tessface mismatches. - Make (part of) mirror-editing code able to use a DM instead of raw mesh, so that we can mirror based on final DM when editing particles using modifier stack (mandatory, since there is no way currently to find orig tessface from an final DM tessface index). Note that this patch is not really nice and clean (current particles are beyond hope on this side anyway), it's more like some urgency bandage. Whole crap needs complete rewrite anyway, BMesh's polygons make it really hard to work with current system (and looptri would not help much here). Also, did not test everything possibly affected by those changes, so it needs some users' testing & validation too. Reviewers: psy-fi Subscribers: dfelinto, eyecandy Maniphest Tasks: T47038 Differential Revision: https://developer.blender.org/D1685
2015-12-21Cleanup: warnings (msvc)Campbell Barton
Part of patch D1670 by @LazyDodo
2015-11-23Cleanup: shadowing (blenkernel)Campbell Barton
2015-11-09Cleanup: avoid incrementing/decrementing id->us outside of BKE_library.Bastien Montagne
We have callbacks for that, they also do some checks and help ensure things are done correctly. Only place where this is assumed not true is blenloader (since here we may affect refcount of library IDs as well...).
2015-11-07Cleanup: spelling, headersCampbell Barton
2015-11-02Fix/workaround T46622: crash w/ metas & particlesCampbell Barton
Metas are scanning all scenes duplis, which can go into particle systems without an initialized derived-mesh. For now just do NULL check, its not correct but real fix is not fitting well with current design.
2015-08-18Refactor translation code out of blenfontCampbell Barton
- Add blentranslation `BLT_*` module. - moved & split `BLF_translation.h` into (`BLT_translation.h`, `BLT_lang.h`). - moved `BLF_*_unifont` functions from `blf_translation.c` to new source file `blf_font_i18n.c`.
2015-04-13Revert "Fix hair random rotation limited to 180 degrees"Sergey Sharybin
This reverts commit 176ed5bfe280ef2151f93c0940d54498aaf00d71.
2015-04-13Fix hair random rotation limited to 180 degreesMai Lavelle
The issue was caused by phase being limited from 0 to 1, which gave only 0..M_PI distribution which is not good enough for good randomness. Now the phase is being randomized across full 0..2*M_PI range.
2015-04-08Particles: Fix for missing particles in render if they're disabled for viewportSergey Sharybin
The issue was introduced in rB4b685e1 and it appears some crazy area still accesses particles for render after deleting it's render data, which broke viewport/render behavior. This commit restores previous G.is_rendering logic and adds corresponding checks to cache construction, so counting is all consistent. Goes to the TODO list to either replace G.is_rendering with eval_ctx or to make it so psys->renderdata always exists during render sync.
2015-04-07Fix T44268: Particles: too many virtual parents + non-100 display% = crashSergey Sharybin
Issue was caused by mismatched logic in counting child/parent particles in job initialization and actual job execution. Confusion here came from mixed usage of psys->renderdata and G.is_rendering. We need to get rid of G.is_rendering and use eval_ctx if it's really needed, but we also might just use psys->renderdata check since it's expected psys to have this structure anyway.
2015-04-04Cleanup: use BKE_animdata_* prefixCampbell Barton
2015-03-25Fix T43694, by Krzysztof Rećko (chrisr), reviewed in D1177.Lukas Tönne
Added some guards to prevent clumping to non existing particles. Also, adjusted threaded child path evaluation, so each child is evaluated once - previously virtual parents were done twice.