move Object.update(...) to ID.update(). since depsgraph update function can now be called on ID types.
also changed how update flags work.
obj.update(scene, 1, 1, 1)
... is now
obj.update({'OBJECT', 'DATA', 'TIME'})
Don't pass scene anymore. This was used for recalculating text but I think this is better dont in a different function.
Also added bpy.path.display_name_from_filepath(), since filepaths are not ensured to be utf8.
same as calling: os.path.splitext(os.path.basename(name))[0].encode("utf8", "replace").decode("utf8")
Keyframing operators now use a dynamically-generated enum for their
"type" property, which determines the Keying Set to use for keyframing
instead of the obscure "index" values which were determined
internally. Internally though, these same indices are still being used
:)
Notes:
- I've kept the menu-building function and the special "menu" operator
for now, since it's better to not "pollute" the actual insert
keyframes operator with hardcoded menu-showing logic. Instead, the
menu operator does that, so that if you like, you could write another
such wrapper that works differently.
- The 'type' properties could have the PROP_HIDDEN flags removed,
though I think it's cleaner to leave these without this option for
now.
Experimental tweak for the "Object Constraints" tab so that it now
shows a warning message instead of the "Add Constraints" button when
the active object is in Pose Mode. Hopefully this will further
alleviate any confusion over Object vs Bone level constraints.
Todo:
While coding this, I noticed that we currently don't have any way of
making help-text labels in UI panels which can span multiple lines
(word-wrapped or manually split). Probably not a critical issue, but
it would be nice for completeness...
Setting the group for F-Curves from the Py-API (i.e. to move F-Curves
from one group to another) was failing. After debugging this, this
functionality should now work correctly, while still prohibiting the
setting of groups on "F-Curves that aren't in actions" (i.e. driver-
fcurves)...
The icons for materials were always lagging or not updating
at all. I also found it suspicious slow...
It appeared that the icons now store a "mip level", where for
every change in Materials 2 render jobs for icons were started,
one for 32x32 pix, one for 96x96. The latter was cancelling out
the first job almost always.
Also made preview renders detect size, to set amount of tiles
to be rendered. Small icons use 1 part, larger previews 16 now.
All in all, behaves much smoother now! But, will also update
the thread Jobs manager to allow "delayed jobs" like for icons,
these are aggressively put as first in the jobs list.
* Removed the unused fuctions spotted by Campbel.
* Removed the gotos to make Ton happy.
* Added better debug prints to disk cache operations.
* Fixed a memory unmap error that seemed to happen on a test file.
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.
* Massive reorganization of pointcache code, things are now cleaner than ever.
* For all but smoke the cache is first written to memory when using disk cache and after that written to disk in one operation. This allows less disk operations and the possibility to compress the data before writing it to disk.
* Previously only smoke cache could be compressed, now the same options exist for other physics types too (when using disk cache). For now the default compression option is still "no compression", but if there aren't any problems this can be set to "light compression" as it's actually faster than no compression in most cases since there's less data to write to the disk. Based on quick tests heavy compression can reduce the file size down to 1/3rd of the original size, but is really slow compared to other options, so it should be used only if file size is critical!
* The pointcache code wasn't really 64bit compatible (for disk cache) until now, so this update should fix some crashes on 64bit builds too. Now all integer data that's saved to disk uses 32 bit unsigned integers, so simulations done on 64bit should load fine on 32bit machines and vice versa. (Important disk cache simulations made on 64bit builds should be converted to memory cache in a revision before this commit).
* There are also the beginnings of extradata handling code in pointcache in anticipation of adding the dynamic springs for particle fluids (the springs need to be stored as extradata into point cache).
* Particles were being read from the cache with a slightly wrong framerate. In most cases this probably wasn't noticeable, but none the less the code is now correct in every way.
* Small other fixes here and there & some cosmetic changes to cache panel, but over all there should be no functional changes other than the new disk cache compression options.
* This whole re-organization also seems to fix bug #25436 and hopefully shouldn't introduce any new ones!
* Argh my bad, sorry about this!
* Now only the actual data array is saved to avoid constant re-allocations, but no relations to active data are kept.
* Also reverted Ton's quick fix for the crash as it's not needed anymore.
Floor constraint didn't work: the defines for the enums were using
the wrong ones, the right ones are not logical... but code and dna
and old files assume these. Now it works :)
Crash in Bezier animation (inserting keys on control points in
curve object). The animation rna paths were not fixed after an
editmode session, which got fixed 2 weeks ago, but for all older
binaries the issue can still pop up.
The crash happened because the RNA array-itterator was not doing
a boundary check, even whilst the array size was passed on to the
itterator callbacks. With rna then writing far outside of valid
memory, very bad and unpredictable corruptions happen.
I've added a range check now, and a decent print to denote the
issue. An assert quit is useless, since a tab-tab on curve objects
will fix the channels nicely.
Example of warning print:
Array itterator out of range: Spline_bezier_points_lookup_int (index 30 range 2)