Commit Graph

250 Commits

Author SHA1 Message Date
808ac6debf Prefetching for movie clips
This commit basically implements frames prefetching for
movie clip datablock.

Number of frames to be prefetched is controlled in User
Preferences, System tab, Prefetch Frames option.

Currently prefetching is destructive-less for movie cache,
meaning mo frames will be removed from the cache when while
prefetching. This is because it's half of simplier to
implement, but it also makes sense from tracking point of
view -- we could want to playback in both directions and
removing frames from behind time cursor is not always a
good idea.

Anyway, smarter prefetching strategy could be developed
later.

Some implementation notes:

- Added MEM_CacheLimiter_get_memory_in_use function to get
  memory usage of specified memory limiter.

- Fixed prototype of MEM_CacheLimiter_get_maximum which
  was simply wrong (used wrong data type for output).

- Added some utility functions to movie clip and movie
  cache for direct cache interaction and obtaining cache
  statistics.

- Prefetching is implemented using general jobs system.
  which is invoking from clip draw function.

- Prefetcing will stop as soon other job or playback starts.
  This is done from performance point of view. Jobs will
  likely require lots of CPU power and better to provide
  whole CPU to it.

  Playback is a bit more complicated case. For jpeg sequence
  playback prefetching while paying back is nice. But trying
  to prefetch heavy exr images and doing color space
  conversion slows down both playback and prefetching.

TODO:

- Think of better policy of dealing with already cached frames
  (like when cached frames from other clips prevents frames
  from current clip to be prefetched)

- Currently a bit funky redraw notification happens from
  prefetch job. Perhaps own ND_ is better to have here.

- Hiding clip while prefetch is active in theory shall stop
  prefetching job.

- Having multiple clips opened on file load will prefetch
  frames for only one of them.
2013-03-20 17:03:20 +00:00
e7c15beaf6 code cleanup: use booleans for mesh and selection code. 2013-03-19 23:17:44 +00:00
88cf1a2bc7 Screen: add exit callback for area and region types, this gets called when
hiding or removing an area or region.
2013-03-15 19:56:29 +00:00
aaa8a13c49 code cleanup: use const events for modal and invoke operators. 2013-03-13 09:03:46 +00:00
a02c8c4177 move toggle drag into a UI handler (was modal operator) 2013-03-03 03:29:57 +00:00
c1ca09b8c8 replace MEM_callocN with MEM_mallocN for events since their overwritten right after. 2013-02-11 10:01:32 +00:00
6341919354 code cleanup: make wmEvent's 'const' in interface code (reduces manual checking that they are not modified). 2013-02-01 01:01:20 +00:00
54223ed05b Add active region for operator execution.
This means you can for example, uv unwrap in quad-view and change settings in the toolbar without defaulting back to the first quad-view region available. 

This may be displayed to the user later, for now this is set on executing registrable operators.
2013-01-30 12:22:02 +00:00
761b380b84 fix [#33841] Disabling and re-enabling live addon crashes blender (modal/draw handler) 2013-01-22 06:16:49 +00:00
337695d496 draw the brush size with pressure applied (when the tablet is used), nice to see the actual size used. 2013-01-16 19:22:15 +00:00
e24443b79a style cleanup 2013-01-09 03:30:15 +00:00
7504cf34b4 This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!

This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!

To make all this work, other changes were also necessary:

* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.

* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.

* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.

* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
  Note: not sure whether we should add that one to all UILayout's prop funcs?

Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
851cb9b345 Added support of J2K codec for Jpeg2000 writing
This codec is absolutely needed to generate DCP using OpenDCP,
before that external application to convert JP2 to J2K was used
which slowed down export a lot.

New codec is exposed to image format settings panel and called
Codec. Default one is JP2 which creates files with .jp2 extension,
new one is called J2K which creates with .j2c extension.

Other changes:
- Fixed avi jpeg warning which was treating as error here.
- Made it so extension is detecting from ImageFormatData instead
  of image file type, which makes it possible to have different
  extension for the same file type depending on it's settings.

  IRIS format should still be changed (depending on number of
  channels it'll be .bw, .rgb or .rgba extension)

- Default image format settings would be set from image buffer
  when re-saving it. Makes it possible to easily open .j2c file
  and save it using J2K codec (without this change it'll save as
  .jp2 using JP2 codec)
2012-12-23 13:57:09 +00:00
3bc3e178b3 style cleanup 2012-12-20 00:29:31 +00:00
5fcb12d754 changing RNA properties now prints python script in the info view.
next will add context so bpy.data.xxx[id] are not used for all references.
2012-12-18 15:22:06 +00:00
957604f895 functions to make a string representation of a property & assignment. 2012-12-18 14:11:19 +00:00
5e9ee25328 style cleanup 2012-12-14 04:38:52 +00:00
96b2dc8e13 style cleanup: changes from recent commits 2012-12-13 01:00:21 +00:00
12b642062c Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability

Short list of main changes:

- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
  Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
  This allows keeping UI and data without actual saves, until you actually save.
  When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v). 
  Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards. 
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
  Old option is called "Save Startup File" the new one "Save User Settings".
  To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
  This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
22505c10f8 fix [#33442] Units
adding meshes were scaling the user input values so the distance on the button didnt relate to the scale of the object added.

Now use an invoke function that scales unset default values.
2012-12-09 10:48:18 +00:00
b91cf60962 Fix #33330: Proxies are not built in Sequencer if preview is visible
Was own regression when was solving conflict between sequencer preview
and compositor jobs. Made it so now only compositor jobs are being
killed from sequencer preview.
2012-11-28 09:36:23 +00:00
4cd129bb50 fix for the update issue reported in [#32452]
When blending shape key, opening the popup didnt execute anything - making it so pressing a button would update the result even if the value didnt change.
2012-11-14 06:13:42 +00:00
8740b6cd88 fix [#33108] Running save_as_mainfile breaks relative texture paths
save-as with path remapping left the paths relate to the file written.
2012-11-07 04:13:03 +00:00
7b60529517 Bugfix #33092
Fluid sim would stop or crash with node editor.

Bug was a real bad one - the code for giving out WM jobs was messed up for long.
It was giving a running fluid job to the compositer even... tsk!

I will go over jobs code carefully next days to see if it all behaves. Now it
allows per owner multiple jobs, provided it has different job_type set.

Also fixed: preview renders (material) were deadslow once a while - caused
by icon render setting miniature tile render sizes. Now it's fast again,
but there are still 3 icon jobs running per UI change... need to check what.
2012-11-06 15:54:04 +00:00
1bcadda46b fix [#30910] Problems: Add Shortcut(s) for "Ctrl Tab" menu
comparing keymaps was too sloppy or too strict, now sloppy keymap comparison works by setting all the operator
properties to their default values if they are not already set, then compare this with the keymap item (ignoring values missing from either one).

... this way any non default keymap setting wont match with an operator menu item which doesnt set this operator at all (a problem sighted in this bug report).


developer notes:
- IDP_EqualsProperties_ex() function adds an argument to treat missing members of either group to act as if there is a match.
- WM_operator_properties_default() function to reset RNA values to their defaults.
- add IDP_spit(), debug only function to print out ID properties.
2012-10-31 20:29:32 +00:00
9efdd09578 Bugfix #33004
Screencast recording stopped on a undo/redo. This was because all thread jobs
were killed then. Now it leaves screen jobs (screen cast) running, that's 
data that doesn't change on undos.

Also renamed jobs_stop_all() to jobs_kill_all() - it terminates threads.
2012-10-29 17:41:19 +00:00
db70bfc206 code cleanup: use functions to initialize selection user data structs, use radius-squared for circle select comparisons.
edge_fully_inside_rect() & edge_inside_rect() args were shorts when all callers were passing ints.
2012-10-05 15:44:11 +00:00
d732e05740 fix for header not updating with an error report when a job finishes.
was reported as a reply to [#32537], but is a different issue then the original report.
2012-09-28 04:00:06 +00:00
1541ee20c8 Improvement to own commit r50810.
Add an optional ghost argument to set the new mouse location when un-grabbing. - without this the mouse would flicker at the old location before moving to the new location - when using the color picker for eg.
2012-09-22 13:23:12 +00:00
25c96bc9f3 code cleanup: remove unused macros, commet some which may be useful later - or good to keep for completeness. quieted some warnings and add flags -Wmissing-include-dirs and -Wno-div-by-zero to cmake/gcc 2012-09-20 01:02:39 +00:00
e75f5c8208 quiet -Wmissing-prototypes warnings, and enable this warning by default for C with gcc.
helps for finding unused functions and making functions static, also did some minor code cleanup.
2012-09-15 01:52:28 +00:00
ee96cde864 style cleanup: whitespace 2012-08-26 11:35:43 +00:00
15bd03f958 fix for missing change to fluidsim from last commit and name jobs a more useful name - 'wm_job'. 2012-08-15 10:03:29 +00:00
97859e8709 add wm job types they are not used yet, so this just defines them for new jobs add add argument to search by job type. 2012-08-15 09:42:06 +00:00
cfb160c764 style cleanup 2012-08-12 21:46:35 +00:00
b96c622015 style cleanup 2012-08-11 22:12:32 +00:00
c567cf3fab code cleanup: WM naming conventions 2012-08-11 21:35:24 +00:00
5e0f254afa utility functions for getting/setting rectangles for operators. 2012-08-08 20:38:55 +00:00
a199ae5368 style cleanup: whitespace, also add '?' to save over popup since it wasnt totally clear it was a question (user pointed this out, they thought it was just notification and lost their work). 2012-07-31 23:06:12 +00:00
a09feb7386 option so operators can be executed with undo enabled (and redo). 2012-06-27 21:41:17 +00:00
ee15754e31 move mouse select options into their own property function - more operators should use these eventually 2012-05-28 05:45:19 +00:00
8b687f6c36 code cleanup: add WM_gesture_lasso_path_to_array, move mouse path to array conversion there. 2012-05-14 12:41:56 +00:00
fef40eda72 Fix related to [#31157]: Tips (descriptions) of macro operators were not set into underlying RNA struct, hence did not show up in UI. 2012-05-05 19:26:53 +00:00
4ff038c411 screenshot operator now adds file extension in the file selector and has its own save options rather then using the render options (works like image save a copy). 2012-04-24 02:01:23 +00:00
bec263e2a3 wm/operator code:
Change operator previous settings initialization not to use the redo stack since this gets cleared and it means only redo operators can re-use last settings.

now this works for import/export as well.
2012-03-21 06:33:31 +00:00
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
7cc206ddca Code Cleanup: remove non existing function declarations.
added some missing functions too - which are not used yep but should be there for api completeness.
* CDDM_set_mloop
* CDDM_set_mpoly
* BLI_mempool_count
2012-02-29 15:00:37 +00:00
2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
44850d6946 Fix #29946: Recover Auto Save defaults to "Short List" View -- Cannot determine dates
Added option display_type to WM_operator_properties_filesel which defines which file
display type (short/list/icons/default) should be used for file browser.

All current operators are using FILE_DEFAULTDISPLAY display type which means display
type will still be calculated based on type of opening file and user preferences
settings. Recover Auto Save operator is now using long display type so file date can
easily be checked now.

Reviewed by Andrea, thanks!
2012-01-24 18:18:51 +00:00
03b0681fe5 running operators now uses last used settings, added reset button to set defaults.
details
- uses redo stack to get recent settings from.
- adds a flag to IDProperties so RNA_property_is_set() can return false even if the property is exists.
- PROP_SKIP_SAVE option skips these settings from getting reset (as with presets).
2012-01-11 19:33:14 +00:00