PythonProject
ActivePublic

Members

  • This project does not have any members.

Properties

Description

Python API for scripting and console editor.

Module Owner: @Campbell Barton (campbellbarton)

Recent Activity

Today

Sybren A. Stüvel (sybren) added a comment to T47811: Blender 2.8x / Python, Proposed Changes.

If we can't actually make use of them in any meaningful way, beyond them acting as type-comments.

For example, if tools to validate types don't work properly when run within Blender.

Code readability is a nice aspect you mention but if we cant validate them its quite weak and likely some are wrong nobody notices.

Mon, Mar 27, 12:08 PM · Restricted Project, Python

Yesterday

Jared Webber (lvxejay) added a comment to T51052: CacheFile Open Operator Crashes Blender.

Operator requires an execution override to work properly:

Sun, Mar 26, 11:03 AM · Platform: Windows, Platform: Linux, Python, Import/Export, BF Blender
Jared Webber (lvxejay) added a comment to T51052: CacheFile Open Operator Crashes Blender.

When called from the Dynamic Context Menu (spacebar), it works just fine

Sun, Mar 26, 10:51 AM · Platform: Windows, Platform: Linux, Python, Import/Export, BF Blender
Jeducious (jameshcrowther) added a comment to T47811: Blender 2.8x / Python, Proposed Changes.

Hi, my comment regards the propsed changes to the scene_update_pre handler. To some extent I'm echoing Brendon's concerns - (repeated below).

Sun, Mar 26, 10:35 AM · Restricted Project, Python
Campbell Barton (campbellbarton) triaged T51052: CacheFile Open Operator Crashes Blender as "Confirmed" priority.
Sun, Mar 26, 9:10 AM · Platform: Windows, Platform: Linux, Python, Import/Export, BF Blender
Jared Webber (lvxejay) created T51052: CacheFile Open Operator Crashes Blender.
Sun, Mar 26, 9:08 AM · Platform: Windows, Platform: Linux, Python, Import/Export, BF Blender
Campbell Barton (campbellbarton) added a comment to T47811: Blender 2.8x / Python, Proposed Changes.

Let's start using [type hints]. Python code can be very "we get this thing from somewhere and pass it along"-like, and figuring out what it is supposed to be can be challenging. By declaring types (even if Python itself doesn't check) IMO we get easier to read & understand code. Furthermore, IDEs can also use those to aid developers with code completion.

Python continues to improve its type declarations, in 3.6x they're quite good, but think its worth seeing how we can get real benefits from them.

In what way are the benefits I described not "real"?

Sun, Mar 26, 7:52 AM · Restricted Project, Python

Tue, Mar 21

Sybren A. Stüvel (sybren) added a comment to T47811: Blender 2.8x / Python, Proposed Changes.

Let's start using [type hints]. Python code can be very "we get this thing from somewhere and pass it along"-like, and figuring out what it is supposed to be can be challenging. By declaring types (even if Python itself doesn't check) IMO we get easier to read & understand code. Furthermore, IDEs can also use those to aid developers with code completion.

Python continues to improve its type declarations, in 3.6x they're quite good, but think its worth seeing how we can get real benefits from them.

Tue, Mar 21, 2:54 PM · Restricted Project, Python

Mon, Mar 20

Campbell Barton (campbellbarton) added a comment to T47811: Blender 2.8x / Python, Proposed Changes.

Replace our own auto-completion with Python's for the Py-Console (more a general TODO).

Again, nice TODO, but think this can be done pretty much any time?

I would be so happy if the history management of our Py-Console would be the same as Python, Bash, ZSH and others. In other words: after pressing up a few times, once you press enter, the new entry is at the bottom of the history, and your "history pointer" is there to; pressing down shouldn't do anything (because you're at the bottom of the history), and pressing up should give you the previous command. Right now you're floating somewhere in the middle of your history.

Mon, Mar 20, 3:43 PM · Restricted Project, Python
Campbell Barton (campbellbarton) edited the description of T47811: Blender 2.8x / Python, Proposed Changes.
Mon, Mar 20, 3:36 PM · Restricted Project, Python
Campbell Barton (campbellbarton) added a comment to T47811: Blender 2.8x / Python, Proposed Changes.

@Sybren A. Stüvel (sybren) using @ is handy but quite a disruptive change.

Mon, Mar 20, 3:33 PM · Restricted Project, Python
Campbell Barton (campbellbarton) edited the description of T47811: Blender 2.8x / Python, Proposed Changes.
Mon, Mar 20, 3:20 PM · Restricted Project, Python

Sat, Mar 18

Campbell Barton (campbellbarton) edited the description of T47811: Blender 2.8x / Python, Proposed Changes.
Sat, Mar 18, 10:01 AM · Restricted Project, Python
Campbell Barton (campbellbarton) edited the description of T47811: Blender 2.8x / Python, Proposed Changes.
Sat, Mar 18, 10:00 AM · Restricted Project, Python

Fri, Mar 17

Campbell Barton (campbellbarton) edited the description of T47811: Blender 2.8x / Python, Proposed Changes.
Fri, Mar 17, 10:20 AM · Restricted Project, Python

Tue, Mar 14

Alexandr Zinovev (raa) abandoned D2453: Add "undo_history" property to bpy.context.

Commited rB1208792adb30
Thanks, @Campbell Barton (campbellbarton)!

Tue, Mar 14, 6:52 PM · Python, BF Blender
Aaron Carlisle (Blendify) closed T30723: Style cleanup suggestion (blender\release\scripts\modules), *Postponed for 2.63 release* as "Archived".
Tue, Mar 14, 3:42 PM · BF Blender, Python
Alexandr Zinovev (raa) updated the diff for D2453: Add "undo_history" property to bpy.context.

Add operators with UNDO flag into C.window_manager.operators.

Tue, Mar 14, 3:28 PM · Python, BF Blender

Mon, Mar 13

Germano Cavalcante (mano-wii) changed the status of T50920: Crash when passing geom and context to bmesh.ops.delete when all is selected from "Invalid" to "Resolved" by committing rB2b3cc2438820: Fix T50920: Adds missing edges on return of bisect operator.
Mon, Mar 13, 1:22 PM · Python, BF Blender

Sun, Mar 12

Aaron Carlisle (Blendify) abandoned D2295: Remove old blender.org theme.

Will be going with a different approach soonish.

Sun, Mar 12, 5:57 PM · Python, BF Blender
Germano Cavalcante (mano-wii) added a comment to T50920: Crash when passing geom and context to bmesh.ops.delete when all is selected.

Thus:

vn, en, fn = len(bm.verts), len(bm.edges), len(bm.faces)
op()
geom += bm.verts[vn:] + bm.edges[en:] + bm.faces[fn:]
Sun, Mar 12, 5:28 PM · Python, BF Blender
Tom Wilson (hedgehog90) added a comment to T50920: Crash when passing geom and context to bmesh.ops.delete when all is selected.

I posted the question on BSE.

Sun, Mar 12, 1:17 PM · Python, BF Blender
Germano Cavalcante (mano-wii) closed T50920: Crash when passing geom and context to bmesh.ops.delete when all is selected as "Invalid".

Actually the crash occurs because the execution of the script is being interrupted before the bmesh.update_edit_mesh(mesh).

Sun, Mar 12, 12:50 AM · Python, BF Blender

Sat, Mar 11

Shane Ambler (sambler) created T50920: Crash when passing geom and context to bmesh.ops.delete when all is selected.
Sat, Mar 11, 10:07 AM · Python, BF Blender
Campbell Barton (campbellbarton) added a comment to D2453: Add "undo_history" property to bpy.context.

Talking with @Bastien Montagne (mont29), P453 - we think it might be best to add undo operators into window_manager.operators list, it allows most flexibility, without this its very hard to reason about actions which have been taken.

Sat, Mar 11, 9:24 AM · Python, BF Blender

Fri, Mar 10

Bastien Montagne (mont29) closed T50907: API documentation link broken in some releases as "Archived".

yeah, need to generate 2.78c API doc… thanks for the report, not a bug in any case.

Fri, Mar 10, 3:28 PM · Python, Documentation
Campbell Barton (campbellbarton) added a comment to D2453: Add "undo_history" property to bpy.context.

Would rather follow logic that toolbar uses to check if an operator will show in the toolbar, this patch basically duplicates that logic.

Fri, Mar 10, 10:57 AM · Python, BF Blender
Michael Otto (mayqel) created T50907: API documentation link broken in some releases.
Fri, Mar 10, 9:30 AM · Python, Documentation

Mon, Mar 6

Valera Barashkov (valera) added a comment to T50721: BVH overlap() failing to detect intersection due to bmesh rotation not updating until script ends.

Thanks! I was so convinced this was a bug, should have check the forums or stack overflow first..

Mon, Mar 6, 5:57 PM · Python

Sun, Mar 5

Dealga McArdle (zeffii) added a watcher for Python: Dealga McArdle (zeffii).
Sun, Mar 5, 9:39 AM

Sat, Mar 4

Alexandr Zinovev (raa) added a reviewer for D2453: Add "undo_history" property to bpy.context: Campbell Barton (campbellbarton).

Talked with @Alexandr Zinovev (raa) and think it might be enough to add a is_last_action() method to Operators. this way you can do:

if context.window_manager.operators[-1].is_last_action():
    ...

Or perhaps better to expose:

context.window_manager.operators.active

Which would be the active operator or None

This is a way to know if an operator is showing up in the toolbox for redo, (which may be useful in general for other tools). And avoids exposing undo stack.

Sat, Mar 4, 10:09 AM · Python, BF Blender
Alexandr Zinovev (raa) updated the diff for D2453: Add "undo_history" property to bpy.context.

Implemented 'Operator.is_last_action' property which returns True if the operator is the last action in undo stack.

Sat, Mar 4, 10:07 AM · Python, BF Blender

Fri, Mar 3

Campbell Barton (campbellbarton) added a comment to D2453: Add "undo_history" property to bpy.context.

Talked with @Alexandr Zinovev (raa) and think it might be enough to add a is_last_action() method to Operators. this way you can do:

Fri, Mar 3, 10:47 AM · Python, BF Blender

Sun, Feb 26

john peterson (bliblubli) closed T50703: numpy crashes on latest linux buildbot as "Resolved".
Sun, Feb 26, 8:41 PM · Python, BF Blender
john peterson (bliblubli) added a comment to T50703: numpy crashes on latest linux buildbot.

yep, latest buildbot works. Can be closed.

Sun, Feb 26, 8:41 PM · Python, BF Blender
patrick gaunt (paddywwoof) added a comment to T50703: numpy crashes on latest linux buildbot.

Confirm that the issue seems to have gone with latest build on my machine. Thanks

Sun, Feb 26, 8:30 PM · Python, BF Blender
Sergey Sharybin (sergey) added a comment to T50703: numpy crashes on latest linux buildbot.

Seems something went wrong with compilation of numpy. Did a fresh git clone of numpy, checked out to v1.10.1 branch (currently official version we bundle) and the issue is now gone.

Sun, Feb 26, 7:28 PM · Python, BF Blender
patrick gaunt (paddywwoof) added a comment to T50703: numpy crashes on latest linux buildbot.

confirm same issue in 2.78b (numpy 1.10.1 as per latest download from blender site) but not previous versions.
I get same crash executing john peterson sample in python terminal, however if I paste into Text editor it runs ok. However if I alter it to

Sun, Feb 26, 6:56 PM · Python, BF Blender

Feb 24 2017

Dalai Felinto (dfelinto) closed T50771: Strange behaviour when selecting geometry in python and using that geometry to do mesh operations via user interface as "Invalid".

It's not a bug, you need to push undo via Python:

Feb 24 2017, 6:32 PM · Python, BF Blender
Julien DUROURE (julien) added projects to T48285: Update callback of API defined property not called on keyframed property: Python, Animation.
Feb 24 2017, 4:50 PM · Animation, Python, BF Blender
Julien DUROURE (julien) added a project to T50771: Strange behaviour when selecting geometry in python and using that geometry to do mesh operations via user interface: Python.
Feb 24 2017, 2:14 PM · Python, BF Blender

Feb 23 2017

Bastien Montagne (mont29) closed T50754: EnumProperty displays errors with special characters as "Archived".

Arg… spent an hour on this before realizing this is good old known issue, see warning in enum prop doc

Feb 23 2017, 2:32 PM · Addons, Python, BF Blender
Vincent Girès (VincentG) added a comment to T50756: Wrong layout alignment.

Oh sorry for the bad report!
And thank you for the answer :)

Feb 23 2017, 10:52 AM · User Interface, Python, BF Blender
Bastien Montagne (mont29) closed T50756: Wrong layout alignment as "Invalid".

There is indeed no bug here, as @Alexandr Zinovev (raa) already explained.

Feb 23 2017, 9:07 AM · User Interface, Python, BF Blender
Alexandr Zinovev (raa) added a comment to T50756: Wrong layout alignment.

UILayout.row is not enough in this case. You have to use UILayout.split:

Feb 23 2017, 8:00 AM · User Interface, Python, BF Blender

Feb 22 2017

Aaron Carlisle (Blendify) assigned T50756: Wrong layout alignment to Alexandr Zinovev (raa).
Feb 22 2017, 6:50 PM · User Interface, Python, BF Blender
Vincent Girès (VincentG) created T50756: Wrong layout alignment.
Feb 22 2017, 6:42 PM · User Interface, Python, BF Blender
Vincent Girès (VincentG) created T50754: EnumProperty displays errors with special characters.
Feb 22 2017, 3:27 PM · Addons, Python, BF Blender
Germano Cavalcante (mano-wii) closed T50721: BVH overlap() failing to detect intersection due to bmesh rotation not updating until script ends as "Invalid".

I took a quick look at your script and... this is not a bug.
You are changing the quaternion rotation of an object expecting its matrix to be automatically updated within the script.

Feb 22 2017, 2:24 AM · Python
Valera Barashkov (valera) added a comment to T50721: BVH overlap() failing to detect intersection due to bmesh rotation not updating until script ends.

Your case worked because the objects already exist in the scene, I assume. If the objects already exist overalp() works for me as well as demonstrated in testing_intersect.py

Feb 22 2017, 1:47 AM · Python