PythonProject
ActivePublic

Members

  • This project does not have any members.
Description

Python API for scripting and console editor.

Module Owner: @Campbell Barton (campbellbarton)

Recent Activity

Yesterday

Kerim Borchaev (warkid) added a comment to T50308: RenderEngine - use of python threads with sleep(0)/wait(0) crash.
I *think* the issue here is that renderengine callabacks can be called from a job, i.e. from non-main Blender thread, if that’s the case those callbacks should definitively *never* use any python threading.
Tue, Jan 17, 12:09 AM · Python, BF Blender

Mon, Jan 16

Kerim Borchaev (warkid) added a comment to T50308: RenderEngine - use of python threads with sleep(0)/wait(0) crash.

Yes, I'm aware that Blender context should not be used in a thread. But my examples I think are completely avoiding it if I'm not mistaken ;)

Mon, Jan 16, 8:34 PM · Python, BF Blender
Bastien Montagne (mont29) added a comment to T50308: RenderEngine - use of python threads with sleep(0)/wait(0) crash.

Hmpff… the main issue is that using python threads inside of Blender is risky at best, it’s only reasonably safe when py threads are fully outside of Blender context (i.e. do not use Blender data, do not call Blender API, are not called by Blender, etc.). I *think* the issue here is that renderengine callabacks can be called from a job, i.e. from non-main Blender thread, if that’s the case those callbacks should definitively *never* use any python threading.

Mon, Jan 16, 5:03 PM · Python, BF Blender
Kerim Borchaev (warkid) added a comment to T50308: RenderEngine - use of python threads with sleep(0)/wait(0) crash.

Is there a possible workaround? Does addon code have any chance to shutdown it's threads before shading mode is toggled? Or defer the toggle so it doesn't happens immediately when Shift-Z is pressed?

Mon, Jan 16, 4:51 PM · Python, BF Blender
Kerim Borchaev (warkid) added a comment to T50308: RenderEngine - use of python threads with sleep(0)/wait(0) crash.

Looks like python threads are just doomed to crash when Shading mode is toggled. It's not just about sleep/wait.
E.g. replacing sleep(0) in the example code with simple with lock: pass makes it crash immediately on second Shift-Z.

Mon, Jan 16, 3:38 PM · Python, BF Blender

Sat, Jan 14

Andreas Esau (ndee) added a comment to T50426: Enum Property names are not displayed correctly.

Ok thanks for the quick answer @Bastien Montagne (mont29)
The global keyword disables the flickering but names could still be mixed up. Some brushes are named twice with the same label.. this is somehow weird.

Sat, Jan 14, 11:20 AM · Python, BF Blender
Bastien Montagne (mont29) closed T50426: Enum Property names are not displayed correctly as "Invalid".

Thanks for the report, but that’s more a known issue than a bug here, as stated by the API documentation, you have to keep a (python local) reference to the strings you return in that items callback, something like this shall work:

Sat, Jan 14, 11:00 AM · Python, BF Blender
Brendon Murphy (meta-androcto) assigned T50426: Enum Property names are not displayed correctly to Bastien Montagne (mont29).
Sat, Jan 14, 10:51 AM · Python, BF Blender
Andreas Esau (ndee) added a comment to T50426: Enum Property names are not displayed correctly.

If the attached video is not displaying correctly.
Here is a link to it:
https://www.dropbox.com/s/bykn28wf4nikht1/blender_enum_flicker_02.mp4?dl=0

Sat, Jan 14, 10:39 AM · Python, BF Blender
Andreas Esau (ndee) created T50426: Enum Property names are not displayed correctly.
Sat, Jan 14, 10:35 AM · Python, BF Blender

Fri, Jan 13

Sergey Sharybin (sergey) added a comment to T50308: RenderEngine - use of python threads with sleep(0)/wait(0) crash.

This is not related to my change actually, but rather specific to how threading works in Python.

Fri, Jan 13, 5:36 PM · Python, BF Blender
Bastien Montagne (mont29) assigned T50308: RenderEngine - use of python threads with sleep(0)/wait(0) crash to Sergey Sharybin (sergey).

Bisection shows that crash appears in rB0cc514ec845e31. @Sergey Sharybin (sergey), Maybe something missing in new toggle code?

Fri, Jan 13, 3:21 PM · Python, BF Blender

Wed, Jan 11

Alexandr Zinovev (raa) updated the diff for D2453: Add "undo_history" property to bpy.context.

Some fixes.

Wed, Jan 11, 4:29 PM · Python, BF Blender

Mon, Jan 9

Rainer Trummer (aliasguru) added a comment to T50359: Failing to import Blender as a python module.

I meant this guide: http://www.gizmoplex.com/wordpress/compile-blender-as-python-module/

Mon, Jan 9, 2:24 PM · Python
Rainer Trummer (aliasguru) added a comment to T50359: Failing to import Blender as a python module.

Just verified the suggestions. Using the raw Pyhton console made no difference, import errors would remain the same. But following the guide here **http://www.gizmoplex.com/wordpress/compile-blender-as-python-module/** (especially the part of copying the needed libs over to the Python35 directory) made it work. Can now successfully use the bpy build!

Mon, Jan 9, 2:24 PM · Python
Bastien Montagne (mont29) updated subscribers of T49919: Invoke popup menu has issue with operators that have custom keymaps.
Mon, Jan 9, 12:55 PM · User Interface, Python, BF Blender
Bastien Montagne (mont29) assigned T49919: Invoke popup menu has issue with operators that have custom keymaps to Alexandr Zinovev (raa).
Mon, Jan 9, 12:55 PM · User Interface, Python, BF Blender

Sat, Jan 7

Alexandr Zinovev (raa) added reviewers for D2453: Add "undo_history" property to bpy.context: Bastien Montagne (mont29), Julian Eisel (Severin).
Sat, Jan 7, 12:52 PM · Python, BF Blender

Fri, Jan 6

Jon Denning (gfxcoder) added a comment to T50372: blf.dimensions reports different text sizes with Region Overlap enabled, 3D View shown, and panels set.

Thanks, @Bastien Montagne (mont29)! That solved the problem!

Fri, Jan 6, 5:34 PM · BF Blender, Python
Rainer Trummer (aliasguru) added a comment to T50359: Failing to import Blender as a python module.

Thanks for your feedback,I will try your suggestions next Monday when I am back in the office.

Fri, Jan 6, 3:07 PM · Python
Bastien Montagne (mont29) closed T50359: Failing to import Blender as a python module as "Invalid".

I would suggest you first try from a raw python console (from MS command line, not from MSVC one).

Fri, Jan 6, 12:32 PM · Python
Bastien Montagne (mont29) closed T50372: blf.dimensions reports different text sizes with Region Overlap enabled, 3D View shown, and panels set as "Invalid".

There is no bug here actually, this is just a matter of font size.

Fri, Jan 6, 11:45 AM · BF Blender, Python

Thu, Jan 5

Vuk Gardašević (lijenstina) added projects to T50372: blf.dimensions reports different text sizes with Region Overlap enabled, 3D View shown, and panels set: Python, BF Blender.
Thu, Jan 5, 2:57 PM · BF Blender, Python

Mon, Jan 2

Karl (KrySoar) added a watcher for Python: Karl (KrySoar).
Mon, Jan 2, 8:56 PM
Bastien Montagne (mont29) added a comment to T47811: Blender 2.8x / Python, Proposed Changes.

hasattr is not enough by far to check for API, it does not handle changes in behavior at all e.g. (we also have an 'hasattr' for DNA, but still need to bump sub-version sometimes).

Mon, Jan 2, 12:27 PM · Restricted Project, Python
Rainer Trummer (aliasguru) created T50359: Failing to import Blender as a python module.
Mon, Jan 2, 11:40 AM · Python
Dalai Felinto (dfelinto) added a comment to T47811: Blender 2.8x / Python, Proposed Changes.

Add an 'API version' number in addition to Blender's version system.

What's the use case here? Most of the time an addon will follow Blender's official releases. In this case, blender version will be enough for doversion. For the case where the script want to be up to date with master, the scripter can afford some hasattr checks. Instead of adding a burden to Blender devs to remember to bump Python APi version.

Mon, Jan 2, 11:22 AM · Restricted Project, Python
Campbell Barton (campbellbarton) edited the description of T47811: Blender 2.8x / Python, Proposed Changes.
Mon, Jan 2, 3:50 AM · Restricted Project, Python
Campbell Barton (campbellbarton) edited the description of T47811: Blender 2.8x / Python, Proposed Changes.
Mon, Jan 2, 3:49 AM · Restricted Project, Python

Thu, Dec 29

Suryavarman (Suryavarman) added a comment to T50337: must be a string, not a str.

Ok. Thank you for your time.

Thu, Dec 29, 3:05 PM · Python, BF Blender
Bastien Montagne (mont29) added a comment to T50337: must be a string, not a str.

Grr stupid phab… So,

Thu, Dec 29, 1:04 PM · Python, BF Blender
Bastien Montagne (mont29) closed T50337: must be a string, not a str as "Invalid".

No bug here, error message is a bit odd and cryptic, but Mesh.materials is readonly, so you can’t edit it tha

Thu, Dec 29, 1:03 PM · Python, BF Blender
Bastien Montagne (mont29) closed D2430: Add a new operator - bpy.ops.ed.undo_redo() .

Committed as rBrBbf7d7bc323d5, thanks.

Thu, Dec 29, 12:43 PM · BF Blender, Python
Bastien Montagne (mont29) accepted D2430: Add a new operator - bpy.ops.ed.undo_redo() .

Talked with @Alexandr Zinovev (raa) on IRC and we agreed on change, so will commit directly.

Thu, Dec 29, 12:24 PM · BF Blender, Python
Suryavarman (Suryavarman) created T50337: must be a string, not a str.
Thu, Dec 29, 12:13 PM · Python, BF Blender
Bastien Montagne (mont29) added inline comments to D2430: Add a new operator - bpy.ops.ed.undo_redo() .
Thu, Dec 29, 11:53 AM · BF Blender, Python
Alexandr Zinovev (raa) added a comment to D2430: Add a new operator - bpy.ops.ed.undo_redo() .

@Bastien Montagne (mont29), it's my bad habit to always return CANCELLED for helper operators in my scripts.

Thu, Dec 29, 11:34 AM · BF Blender, Python
Bastien Montagne (mont29) added a comment to D2430: Add a new operator - bpy.ops.ed.undo_redo() .

Feature looks good, just one odd point to me, noted in comment below.

Thu, Dec 29, 10:22 AM · BF Blender, Python

Wed, Dec 28

Joshua Leung (aligorith) closed T49816: Can't set influence of NLAStrip using Python as "Resolved" by committing rB3cbe95f68312: Fix T49816: Keyframing NLA Strip influence from Python set keyframes in the….
Wed, Dec 28, 1:48 PM · Animation, Python

Tue, Dec 27

Kerim Borchaev (warkid) added a comment to T50308: RenderEngine - use of python threads with sleep(0)/wait(0) crash.

Not sure what to do anyway, unless you can show us that Blender is responsible for that.

Tue, Dec 27, 5:36 PM · Python, BF Blender
Bastien Montagne (mont29) added a project to T50308: RenderEngine - use of python threads with sleep(0)/wait(0) crash: Python.
Tue, Dec 27, 3:43 PM · Python, BF Blender

Sat, Dec 24

Alexandr Zinovev (raa) added a comment to D2430: Add a new operator - bpy.ops.ed.undo_redo() .

Here is an example of what we can do using the operator:

Sat, Dec 24, 11:26 AM · BF Blender, Python
Brendon Murphy (meta-androcto) removed a reviewer for D2430: Add a new operator - bpy.ops.ed.undo_redo() : Andrew Hale (trumanblending).
Sat, Dec 24, 12:07 AM · BF Blender, Python

Fri, Dec 23

Aaron Carlisle (Blendify) removed a reviewer for D2430: Add a new operator - bpy.ops.ed.undo_redo() : Campbell Barton (campbellbarton).
Fri, Dec 23, 11:51 PM · BF Blender, Python
Brendon Murphy (meta-androcto) added reviewers for D2430: Add a new operator - bpy.ops.ed.undo_redo() : Bastien Montagne (mont29), Brendon Murphy (meta-androcto).

add reviewers

Fri, Dec 23, 11:39 PM · BF Blender, Python
Alexandr Zinovev (raa) created D2430: Add a new operator - bpy.ops.ed.undo_redo() .
Fri, Dec 23, 10:40 PM · BF Blender, Python

Wed, Dec 21

Brian Savery (bsavery) added a comment to T47811: Blender 2.8x / Python, Proposed Changes.

1/ "Use Python 3.6 Literal String Interpolation for all string formatting."
Q1/ Will the move to Python 3.6 Break many addons?

Very unlikely, I don't think Python upgrades caused many problems previously?

Wed, Dec 21, 11:31 PM · Restricted Project, Python

Tue, Dec 20

Julian Eisel (Severin) moved T49919: Invoke popup menu has issue with operators that have custom keymaps from Backlog to Bugs/Conflicts/etc. on the User Interface board.
Tue, Dec 20, 11:04 PM · User Interface, Python, BF Blender

Dec 10 2016

Thomas Szepe (hg1) added inline comments to D2404: Fix: get bgl methods working with buffer objects.
Dec 10 2016, 1:56 PM · Python, BF Blender
Porteries Tristan (panzergame) added inline comments to D2404: Fix: get bgl methods working with buffer objects.
Dec 10 2016, 10:30 AM · Python, BF Blender