Age | Commit message (Collapse) | Author |
|
Useful for writing asset-libraries to a file, eg.
`bpy.data.libraries.write(filepath, datablocks, relative_remap=False, fake_user=False)`
|
|
BKE_main_id_tag_/BKE_main_id_flag_ were horrible naming now that we split those
into flags (for presistent one) and tags (for runtime ones).
Got rid of previous 'tag_' functions behavior (those who were dedicated shortcuts
to set/clear LIB_TAG_DOIT), so now '_tag_' functions affect tags, and '_flag_'
functions affect flags.
|
|
each newly appended item except Groups and Objects.
|
|
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
|
|
linking API funcs would use 'name, idcode', when all other code here uses
(more sensible) 'idcode, name'.
Also, use 'name' arg name when we expect a bare name, without the prepended ID code, and
'idname' arg name when we expect a complete ID name.
And here too, idcode shall be short, not int!
|
|
This commits does mostly two things:
* Get rid of bContext parameter: I can see no real good reason to pass such a high-level data
to such low-level code... It also makes it more difficult to call when you do not have
a context available.
* Cleanup the instantiating part.
Last point is the most risky - previous code was sometimes quite confusing and hard to follow,
from tests nothing behaves differently in new code, but some hidden corner case may show up.
Anyway, no change in behavior is expected from this commit, if it happens please file a bugreport!
|
|
but only linking of datablocks!
|
|
This could cause problems since they could be any int,
then passed directly to internal functions that assume bools.
|
|
Setting all values of a tuple is such a common operation that it deserves its own macro.
Also added Py_INCREF_RET to avoid confusing use of comma operator.
|
|
Opted to keep includes if they are used indirectly (even if removing is possible).
|
|
Defer creating the Python objects until after appending is finished
because NodeTree's types are not initialized until then.
|
|
|
|
|
|
- remove unused defines.
- quiet some shadow warnings.
- bevel, ifdef out some asserts that are too common.
- style
|
|
from Lawrence D'Oliveiro (ldo)
- more comments
- more uses of bool type
- define symbol for length of in_use array in check_for_dupid
|
|
|
|
C with gcc.
helps for finding unused functions and making functions static, also did some minor code cleanup.
|
|
shouldnt be NULL.
also remove IDP_AppendArray's return value which wasnt the new item in the array (which is odd/misleading), but wasnt used anywhere either.
|
|
|
|
- style - multi-line ifs move braces onto new lines.
- iterators - convert some to macros, other split up and move brace.
|
|
|
|
|
|
|
|
|
|
was doing an unnecessary (and incorrect) library lookup.
|
|
- strict check for rna properties
- formatting edits (120 line width)
- use PyDoc_STRVAR macros for getset docstrings
|
|
don't store operator instances and operator functions have access to the context if they need the current screen.
also add some more py api file descriptions.
|
|
|
|
only image paths were getting corrected, now all paths will (scene image seq strips, pointcache etc)
|
|
http://markmail.org/message/fp7ozcywxum3ar7n
|
|
|
|
|
|
context, means the BGE doesnt need to make a new empty context just to pass as an arg.
added doxygen description too.
this quiets the print when the BGE does linking.
|
|
|
|
into the scene and another that just links/appends.
|
|
|
|
the list to load with the actual datablocks, this is convenient because it saves the script author having to find them after.
also raise warnings rather then errors if the datablock can't be found.
|
|
also fixed a possible bug assigning incorrect DPX function types to
imbuf.
|
|
|
|
|
|
|
|
http://www.blender.org/documentation/blender_python_api_2_56_3/bpy.types.BlendDataLibraries.html#bpy.types.BlendDataLibraries.load
|
|
flag on exceptions.
|
|
|
|
|
|
this is not well suited to RNA so this is a native python api.
This uses:
bpy.data.libraries.load(filepath, link=False, relative=False)
however the return value needs to use pythons context manager, this means the library loading is confined to a block of code and python cant leave a half loaded library state.
eg, load a single scene we know the name of:
with bpy.data.libraries.load(filepath) as (data_from, data_to):
data_to.scenes = ["Scene"]
eg, load all scenes:
with bpy.data.libraries.load(filepath) as (data_from, data_to):
data_to.scenes = data_from.scenes
eg, load all objects starting with 'A'
with bpy.data.libraries.load(filepath) as (data_from, data_to):
data_to.objects = [name for name in data_from.objects if name.startswith("A")]
As you can see gives 2 objects like 'bpy.data', but containing lists of strings which can be moved from one into another.
|