Page MenuHome

PythonProject
ActivePublic

Members

  • This project does not have any members.

Watchers (9)

Details

Description

Python API for scripting and console editor.

Module Owner: @Campbell Barton (campbellbarton)

Recent Activity

Yesterday

Campbell Barton (campbellbarton) closed T59090: Confusing DepsgraphUpdate fields as Resolved.

Makes sense then, added note comments in RNA and renamed back (use 'is_' prefix since this is a read-only boolean. rB5a34897c260b3bfae3e4721e896d9048cfa2cd82)

Thu, Dec 13, 1:20 PM · Python, BF Blender

Wed, Dec 12

Jacques Lucke (JacquesLucke) updated subscribers of T59250: Missing events in modal operator.

I think that is intended behavior. By pressing these keys you register another event handler that can decide whether to pass through events or not. It's the same when your modal operator does not return {'PASS_THROUGH'}. Modal operators "below" your operator will never see those.

Wed, Dec 12, 3:51 PM · Python, BF Blender
Dominik Penk (DominikP) created T59250: Missing events in modal operator.
Wed, Dec 12, 3:42 PM · Python, BF Blender

Tue, Dec 11

Brecht Van Lommel (brecht) closed T56620: Python: New Material IO API as Resolved.
Tue, Dec 11, 3:58 PM · BF Blender: 2.8, Python
Brecht Van Lommel (brecht) closed T56620: Python: New Material IO API, a subtask of T47811: Blender 2.8x / Python, Proposed Changes, as Resolved.
Tue, Dec 11, 3:58 PM · BF Blender: 2.8, Python
Brecht Van Lommel (brecht) edited projects for T52827: Proposal, RNA API direct memory access for arrays via buffer protocol, added: Python; removed BF Blender: 2.8.
Tue, Dec 11, 3:51 PM · Python

Mon, Dec 10

Sergey Sharybin (sergey) closed T58928: New Action causes crash when duplicating bone as Resolved by committing rB9fa408f51b70: Fix T58928: New Action causes crash when duplicating bone.
Mon, Dec 10, 4:07 PM · Python, BF Blender
Brecht Van Lommel (brecht) added a comment to T59090: Confusing DepsgraphUpdate fields.

@Campbell Barton (campbellbarton), there is a semantic difference. In those cases "dirty" means data is out of date and needs to be refreshed (or saved) in some way. With this API we are merely informing the script that some data has changed, if the script then needs to refresh something in response to that is another matter. In depsgraph_update_post and RenderEngine.view_update the data has already been refreshed on the Blender side, so is also not dirty anymore.

Mon, Dec 10, 11:06 AM · Python, BF Blender
Philipp Oeser (lichtwerk) assigned T58928: New Action causes crash when duplicating bone to Sergey Sharybin (sergey).

Asserts here
BLI_assert(pchan_index < MEM_allocN_len(pose->chan_array) / sizeof(bPoseChannel *));

Mon, Dec 10, 10:07 AM · Python, BF Blender
domlysz (domlysz) created T59113: Addon's keymaps are not registered at Blender opening if the addon's enable state is saved in user preferences.
Mon, Dec 10, 9:59 AM · Python, BF Blender
Philipp Oeser (lichtwerk) closed T59044: Cannot programmatically set context area to FILE_BROWSE as Invalid.

Yes, the error message for not finding a string in an enum is truncated to 200 characters:

Mon, Dec 10, 9:42 AM · Python, BF Blender: 2.8
Paul Melis (paulmelis) added a comment to T59090: Confusing DepsgraphUpdate fields.

Just chiming in here as the OP: renaming is_dirty_xxx to recalculate_xxx without negating the value would seem to just as confusing to me (e.g. moving a camera would trigger with recalculate_geom set to True). But maybe I'm misunderstanding what exactly the flags are supposed to signal to downstream users of depsgraph updates (e.g. a render engine script). I originally expected the flags to indicate for which objects the local (downstream) copy of the scene needs to be updated to match the current depsgraph. But it seems that that is a secondary usage, as the flags actually specify which parts of the depsgraph itself need updating. Which is surprising, because what if the downstream script does not handle the updated depsgraph part and therefore doesn't take any action on them to update?

Mon, Dec 10, 9:19 AM · Python, BF Blender
Campbell Barton (campbellbarton) added a comment to T59090: Confusing DepsgraphUpdate fields.

@Brecht Van Lommel (brecht) as far as I can see dirty applies here: internally ID_RECALC_TRANSFORM / ID_RECALC_GEOMETRY means this data needs to be recalculated, and that the current state isn't ensured to be up to date.

Mon, Dec 10, 3:40 AM · Python, BF Blender
Brecht Van Lommel (brecht) assigned T59090: Confusing DepsgraphUpdate fields to Campbell Barton (campbellbarton).

@Campbell Barton (campbellbarton), please revert rB45fdf41be8 and rB6d38d824377.

Mon, Dec 10, 12:26 AM · Python, BF Blender

Sun, Dec 9

Paul Melis (paulmelis) added a comment to T59089: Custom render engine not being called for interactive rendering, get EVEE instead..

well, no shading at all, but that's to be expected since you don't seem to have implemented any drawing in view_draw yet.

Sun, Dec 9, 11:27 PM · Python, BF Blender
Paul Melis (paulmelis) added a comment to T59090: Confusing DepsgraphUpdate fields.

This is the conventional terminology in computing. Read "is dirty" as meaning "needs cleanup" or in this case, "needs updated".

Sun, Dec 9, 11:25 PM · Python, BF Blender
Benjamin Humpherys (brhumphe) added a comment to T59089: Custom render engine not being called for interactive rendering, get EVEE instead..

Confirmed on 168a6a4bfc1 on windows. Running the script AND setting the renderer from the command line does not update which engine is used in the renderer shading mode in the 3d viewport, despite the mode being set:

>>> bpy.context.scene.render.engine
'custom_renderer'
Sun, Dec 9, 11:23 PM · Python, BF Blender
Benjamin Humpherys (brhumphe) added a comment to T59090: Confusing DepsgraphUpdate fields.

It seems contradictory when something called is_xxx_dirty being True actually means "not updated".

Sun, Dec 9, 10:47 PM · Python, BF Blender
Paul Melis (paulmelis) added a comment to T59090: Confusing DepsgraphUpdate fields.

Hmm, more weird behaviour:

Sun, Dec 9, 10:37 PM · Python, BF Blender
Paul Melis (paulmelis) created T59090: Confusing DepsgraphUpdate fields.
Sun, Dec 9, 10:28 PM · Python, BF Blender
Paul Melis (paulmelis) created T59089: Custom render engine not being called for interactive rendering, get EVEE instead..
Sun, Dec 9, 10:06 PM · Python, BF Blender
Benjamin Humpherys (brhumphe) added a comment to T59044: Cannot programmatically set context area to FILE_BROWSE.

The problem is the message does not correctly show all the valid enum values. For example, 'CONSOLE' is truncated.

Sun, Dec 9, 7:07 AM · Python, BF Blender: 2.8

Sat, Dec 8

Benjamin Humpherys (brhumphe) added a project to T59044: Cannot programmatically set context area to FILE_BROWSE: Python.
Sat, Dec 8, 10:50 PM · Python, BF Blender: 2.8
Jose Conseco (joseconseco) reopened T58734: bvhtree.fromObject - error ( returned NULL without setting an error) in blender 2.8 as "Open".

Thanks for the fix. The operation bvhtree .fromObject now works when executed once. But it crashes on second run of operation each time:
Steps to reproduce:
run in console:

from mathutils.bvhtree import BVHTree
BVHTree.FromObject(C.active_object, C.depsgraph) 
BVHTree.FromObject(C.active_object, C.depsgraph)  #it will crash here (no error)
Sat, Dec 8, 6:19 PM · BF Blender, Python
Philipp Oeser (lichtwerk) triaged T58937: Appended menus to VIEW3D_MT_editor_menus are not displayed as Confirmed priority.

Seems like VIEW3D_HT_header calls
VIEW3D_MT_editor_menus.draw_collapsible(context, layout)

Sat, Dec 8, 3:30 PM · Python, BF Blender

Fri, Dec 7

Bastien Montagne (mont29) closed T58856: Python: "to_mesh" broken in 2.8 as Resolved by committing rBde491abf9962: Fix modifiers evaluation outside of depsgraph/CoW context..
Fri, Dec 7, 6:59 PM · Python, BF Blender: 2.8
Bastien Montagne (mont29) added a comment to T58856: Python: "to_mesh" broken in 2.8.

Please do not merge reports just because they use the same general 'end tool'… applying armature modifier has little to see with applying one using curves.

Fri, Dec 7, 3:34 PM · Python, BF Blender: 2.8
Dalai Felinto (dfelinto) added a comment to T58734: bvhtree.fromObject - error ( returned NULL without setting an error) in blender 2.8.

For the record, the API changed, see e7c3f7ba6f1385a2138862de8568e571fa97b5b4.

Fri, Dec 7, 3:02 PM · BF Blender, Python
domlysz (domlysz) created T58937: Appended menus to VIEW3D_MT_editor_menus are not displayed.
Fri, Dec 7, 2:22 PM · Python, BF Blender
Philipp Oeser (lichtwerk) edited projects for T58856: Python: "to_mesh" broken in 2.8, added: BF Blender: 2.8, Python; removed BF Blender.
Fri, Dec 7, 2:14 PM · Python, BF Blender: 2.8
Terrell (GameDragon) created T58928: New Action causes crash when duplicating bone.
Fri, Dec 7, 1:20 PM · Python, BF Blender
Dalai Felinto (dfelinto) added a comment to T58641: Identifier resulted from prop_search is prefixed by three spaces..

For the records, this also causes T58917 to happen. I will see there if I can change the stored data to pointer (don't recall why I used strings in the first place).

Fri, Dec 7, 11:52 AM · Python, BF Blender

Thu, Dec 6

Brecht Van Lommel (brecht) closed T55778: Cannot link object via bpy.context.collection.objects.link() after manual Delete operator invocation (*) as Resolved.

This appears to be fixed.

Thu, Dec 6, 8:02 PM · Python, BF Blender: 2.8
Jacques Lucke (JacquesLucke) assigned T58803: module 'bpy.utils' has no attribute 'register_tool' to Campbell Barton (campbellbarton).
Thu, Dec 6, 3:29 PM · BF Blender, Python

Wed, Dec 5

Brecht Van Lommel (brecht) closed T58823: API object.hide_render flag and its relation to collection visibility inconsistent as Archived.

object.hide_render does not tell you if the object is hidden, it only returns the value of the property as set by the user. This is the same as in 2.7x.

Wed, Dec 5, 11:05 PM · Python, BF Blender: 2.8, BF Blender
Benjamin Humpherys (brhumphe) added a project to T58803: module 'bpy.utils' has no attribute 'register_tool': Python.
Wed, Dec 5, 10:19 PM · BF Blender, Python
Paul Melis (paulmelis) added a comment to T58823: API object.hide_render flag and its relation to collection visibility inconsistent .

Wed, Dec 5, 9:42 PM · Python, BF Blender: 2.8, BF Blender
Paul Melis (paulmelis) created T58823: API object.hide_render flag and its relation to collection visibility inconsistent .
Wed, Dec 5, 9:41 PM · Python, BF Blender: 2.8, BF Blender
Alexander Gavrilov (angavrilov) closed T58391: Curve shape keys python data gets mixed up and extra points added as Resolved by committing rB16aa7dfa196d: Fix T58391: correctly handle Curve Shape Key layout in Python API..
Wed, Dec 5, 4:37 PM · Python, BF Blender: 2.8
Alexander Gavrilov (angavrilov) claimed T58391: Curve shape keys python data gets mixed up and extra points added.

Curve shapekey data is more complicated than coordinates, and even more so in 2.8 after rB12788906. I suspect python API wrappers don't take that into account.

Wed, Dec 5, 12:57 PM · Python, BF Blender: 2.8
Philipp Oeser (lichtwerk) edited projects for T58391: Curve shape keys python data gets mixed up and extra points added, added: BF Blender: 2.8, Python; removed BF Blender.
Wed, Dec 5, 12:02 PM · Python, BF Blender: 2.8
Bastien Montagne (mont29) closed T58734: bvhtree.fromObject - error ( returned NULL without setting an error) in blender 2.8 as Resolved.
Wed, Dec 5, 11:29 AM · BF Blender, Python

Tue, Dec 4

Jose Conseco (joseconseco) created T58734: bvhtree.fromObject - error ( returned NULL without setting an error) in blender 2.8.
Tue, Dec 4, 8:03 PM · BF Blender, Python
Jacques Lucke (JacquesLucke) added a comment to T58641: Identifier resulted from prop_search is prefixed by three spaces..

Maybe the description of ID.name should be changed.
So we have three types of names in the api now?

  • object name
  • object name + library part
  • prefix + object name + library part
Tue, Dec 4, 4:54 PM · Python, BF Blender
Bastien Montagne (mont29) added a comment to T58641: Identifier resulted from prop_search is prefixed by three spaces..

And I do not think prop_search storing extended name is fine, it's just way too complicated to change this to store actual full ID name, so not worth the effort imho.

Tue, Dec 4, 4:50 PM · Python, BF Blender
Bastien Montagne (mont29) added a comment to T58641: Identifier resulted from prop_search is prefixed by three spaces..

Making name collision impossible with a single string is close to impossible (guess since ID names have fixed max length, we could force lib part beyond the 67th char to get that result, but would not be very user-friendly display then).

Tue, Dec 4, 4:49 PM · Python, BF Blender
Jacques Lucke (JacquesLucke) added a comment to T58641: Identifier resulted from prop_search is prefixed by three spaces..

Ok, I think that .prop_search uses the extended names is fine. (If it is documented somewhere what all the letters mean exactly. I have not found any docs for that yet.)

Tue, Dec 4, 4:27 PM · Python, BF Blender
Bastien Montagne (mont29) added a comment to T58641: Identifier resulted from prop_search is prefixed by three spaces..

But if you are interested in diving into the search_prop & friends maze to avoid that behavior, be my guest. For now I think we have something that works well and easily in all decent cases. If user wants to start naming their object L Cube [untitled.blend], that’s their issue. Just use Pointer prop to store IDs then.

Tue, Dec 4, 4:13 PM · Python, BF Blender
Bastien Montagne (mont29) added a comment to T58641: Identifier resulted from prop_search is prefixed by three spaces..

If you are crazy enough to name your objects that way, there is no miracle indeed. That’s why I said that ID should be stored in Pointer prop, not string one, unless absolutely not possible to do otherwise.

Tue, Dec 4, 4:10 PM · Python, BF Blender
Jacques Lucke (JacquesLucke) added a comment to T58641: Identifier resulted from prop_search is prefixed by three spaces..

Well, this little trick does not make id names really unique, right? When I have two local objects named Cube and L Cube [untitled.blend] and one linked object called Cube (linked from a file called untitled.blend), then I can't access the linked object object from bpy.data.objects[...].

Tue, Dec 4, 4:05 PM · Python, BF Blender