Commit Graph

335 Commits

Author SHA1 Message Date
d75bca1842 Cleanup: replace more direct id->us handling by calls to BKE_library API. 2015-11-11 20:21:37 +01:00
e5916187e8 First step to handle missing libs/datablocks when reading a file.
Idea is, instead of ignoring completely missing linked datablocks, to
create void placeholders for them.

That way, you can work on your file, save it, and find again your missing data once
lib becomes available again. Or you can edit missing lib's path (in Outliner),
save and reload the file, and you are done.

Also, Outliner now shows broken libraries (and placeholders) with a 'broken lib' icon.

Future plans are also to be able to relocate missing libs and reload them at runtime.

Code notes:
    - Placeholder ID is just a regular datablock of same type as expected linked one,
      with 'default' data, and a LIB_MISSING bitflag set.
    - To allow creation of such datablocks, creation of datablocks in BKE was split in two step:
        + Allocation of memory itself.
        + Setting of all internal data to default values.

See also the design task (T43351).

Reviewed by @campbellbarton, thanks a bunch!

Differential Revision: https://developer.blender.org/D1394
2015-10-20 14:44:57 +02:00
b8a8059e21 Fix for text editor un-indent undo
Same issue as T44381, re-use logic for indent.
2015-09-16 03:35:25 +10:00
aca40295e8 Check ftell return values 2015-06-05 11:46:01 +10:00
c740027e30 Fix T44381: Text Editor: Un-indent undo fails
D1284 by @mikidep
2015-05-07 05:04:05 +10:00
dbee634572 Fix typos. 2015-05-04 01:53:34 +09:00
920fa0f963 Fix double-free on copied Text compiled py-code 2015-04-28 01:18:50 +10:00
a9dbaf3755 Ensure BLI_stat() return value is checked.
also add function attrs on BLI_fileops to ensure they're used correctly.
2015-02-18 07:27:27 +11:00
b12f3cbee7 cleanup: style 2015-02-07 04:50:21 +11:00
32125c40d3 Fix own mistake unlinking text (recent commit) 2015-02-03 16:39:32 +11:00
eb150ef337 Node UI: add support to show text-blocks in frames
Some node setups benefit from being documented like this.
2015-01-29 22:04:32 +11:00
fca515838e Cleanup: strcmp/strncmp -> STREQ/STREQLEN (in boolean usage).
Makes usage of those funcs much more clear, we even had mixed '!strcmp(foo, bar)'
and 'strcmp(foo, bar) == 0' in several places...
2015-01-26 16:59:24 +01:00
95847f6ac7 Fix T43159: Copying of linked datablocks using relpath leads to invalid paths in new copies.
Propper fix reverting most of rB60e70c0c6014e5, which was only partial specific fix.
This code uses generic `BKE_id_lib_local_paths()` func to handle all possible paths.

Reviewers: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D977
2015-01-09 09:53:58 +01:00
60e70c0c60 Fix T43159: Copying of linked datablocks using relpath leads to invalid paths in new copies.
Simply have to rebase onto main filepath when copying, if source datablock is lib and path is relative.

Afaict, only affected Image and Text datablocks. MovieClip would also be a candidate, but has
no copy implemented currently.
2015-01-08 14:38:48 +01:00
20a1778148 Cleanup: more int->bool. 2014-12-01 17:11:55 +01:00
46e2d5ee41 Cleanup: typo 2014-11-21 14:16:35 +01:00
5c633d3ba0 Fix for Ctrl+Del/Backspace not setting text dirty 2014-10-29 13:52:06 +01:00
b15d9ecb6d Cleanup: remove paranoid NULL checks 2014-10-06 12:23:47 +02:00
96ac3c2f7d Text Editor: reload missed adding new-line
Logic for load/reload was duplicated, Fix T28087 missed reload.

De-duplicate, also replace stat -> BLI_stat
2014-09-17 19:32:52 +10:00
1dddad93c4 Fix Text editor home/end keys when theres a selection 2014-08-29 14:53:12 +10:00
00b29156e0 Defines: replace ELEM3-16 with ELEM(...), that can take varargs 2014-07-20 01:33:40 +10:00
973f95fa9d Fix T40157: Loading movies larger than 4GB in size fails
Issue was caused by _wstat returning EOVERFLOW error because
of file size didn't fit into stat structure which was using
long datatype.

The idea of this patch is to use _wstat64 and _stat64 structure
which is capable storing 64bit file sizes.

Made it a typedef for stat structure used by BLI_stat function
in order to make code easier to follow and avoid ifdefs all
over the place.

Additionally solved issue with BLI_exists which was wrongly
returning False in cases destination file is larger then 4GB.
2014-05-28 23:21:39 +06:00
a2c107aef1 Code cleanup: use 'const' for arrays (blenkernel) 2014-04-27 00:25:15 +10:00
7c78bcef6c Fix for crash un-indenting in the text editor 2014-04-14 13:28:09 +10:00
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
18fde352bf Fix compile error when compiling without python. 2014-02-27 21:16:01 +01:00
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
37026b12ec Code cleanup: use bool for static methods 2014-02-05 22:36:15 +11:00
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
0c6a01ca00 Use includes for blenderplayer stubs
exposes many incorrect and redundant stubs
2014-01-28 01:55:10 +11:00
7c6f60572b Fix T38264: undo/redo broken with text overwrite mode in text editor (insert key). 2014-01-20 22:13:42 +01:00
1f2136b329 Python/Depsgraph: bpy.data.*.is_updated now detects add/remove of any datablock.
Previously this only worked for some datablocks relevant to rendering, now it
can be used to detect if any type of datablock was added or removed (but not
yet to detect if it was modified, we need many more depsgraph tags for that).

Most of the changes are some function parameter changes, the important parts
are the DAG_id_type_tag calls.

Reviewed By: sergey, brecht

Differential Revision: https://developer.blender.org/D195
2014-01-15 16:47:53 +01:00
b9114cb609 UI: Use bool rather then int/short's where possible 2014-01-04 18:10:01 +11:00
Dalai Felinto
a03aec3178 Fix: Text editor, blank lines were being indented
Summary: fixes T37613

Reviewers: campbellbarton, sergey

Reviewed By: sergey

Maniphest Tasks: T37613

Differential Revision: http://developer.blender.org/D42
2013-11-26 04:51:06 -02:00
89a02fc4ef fix [#36656] text editor undo error when undoing paste command
When tabs to spaces is enabled and a paste command is undone, the improper number of characters could get removed. Also fixed issue with shift + left/right only selecting a max of 1 character.
2013-09-05 21:36:19 +00:00
26cbf331a8 text editor cursor motion (left/right arrows) with selected text typically jumps to either side of the selection previously the cursor would move and loose the selection too.
text button fields already did this.
2013-09-02 00:47:27 +00:00
09aadea2cc remove unused code from object convert and indent. 2013-07-27 09:20:10 +00:00
3ff3d1bc0f replace use of strcat() where the string offset is known.
also correct bad logic with converting a textblock to 3d-text, bytes-vs-number of chars wasn't handled right.
2013-07-23 12:49:30 +00:00
8bf5ec4f8a code cleanup: de-duplicate BLI_ghashIterator_new/init and disable unused text undo print function. 2013-07-21 17:05:41 +00:00
177ea51fab fix for unintended fall-through in switch statement, also reduce undo_pos increments in text editor. 2013-07-21 08:34:02 +00:00
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00
d4ff53b760 fix [#36066] crash when Tab out text object
the way Curve.len is used at the moment is really stupid, calculate string size on save for now, but should really store the length in bytes and total number of characters.
2013-07-09 06:21:45 +00:00
d8c2709414 Better API design for making text datablocks after loading.
An optional 'internal' argument was added to the bpy.data.texts.load() operator.  
The changes in revision 57153 were reverted, so that the is_in_memory and is_dirty
properties of text datablocks are not editable again.

In the C API layer, BKE_text_load_ex() was introduced to allow for optionally
making text datablocks internal after loading.
2013-06-02 17:52:06 +00:00
cf3d638681 remove unneeded null check in draw_viewport_name 2013-05-08 12:53:14 +00:00
9e75d276e3 holding ctrl when using arrow keys in the text editor didn't navigate newlines. 2013-05-01 00:15:22 +00:00
858ff6b696 Fix for [#34898] Typo in error message of mathutils.Vector
* Also fixed some more cases of "more then" -> "more than".
2013-04-07 15:09:06 +00:00
002dbaece7 style cleanup 2013-04-05 16:55:12 +00:00
1e8d69ac74 Use of text datablocks for storing Python style modules.
Suggested by Brecht Van Lommel and Campbell Barton through code review comments.

Previously style modules were external Python script files whose absolute paths
were kept in .blend files.  Now style modules are stored in .blend files as text
datablocks.

Style modules are configured in three steps:
1. Open an external style module file (or create a new text datablock) in the
Text Editor in Blender.
2. Add a style module to the list of style modules (by pressing the "Add" button)
in the Render Layer properties window.
3. Click the name entry and select the style module from the drop-down menu.
2013-04-03 00:00:29 +00:00
da4401587c Fix [#34768] Out of bounds access in console selection.
txt_utf8_column_to_offset(): don't advance the offset anymore if a null character is found.
2013-03-27 09:57:34 +00:00