PythonProject
ActivePublic

Members

  • This project does not have any members.

Details

Description

Python API for scripting and console editor.

Module Owner: @Campbell Barton (campbellbarton)

Recent Activity

Today

Amir (Warrior) added a comment to T54314: Contents of "Viewer Node" image block do not get updated .

@Philipp Oeser (lichtwerk) @Jeroen Bakker (jbakker) Thanks for investigating this more. I also remember at some point when I was accessing the pixels directly through "Viewer Node" image block and stored them on disk. What I realized however was the pixels were sort of rotated. I remember the depth map rendering that I got was shown 90 degrees rotated. So I have a request from you: I would appreciate if you can provide a nice Python API that allows people to easily access the rendering results without having to store the renderings on disk. Maybe bpy.ops.render.render() could take an argument like keepInMemory=True. Then people can access the rendering results through something like renderings = np.array(bpy.ops.render.results). The should also account for having a couple of output nodes. For instance, if in the node editor I have 5 Viewer nodes, renderings should be a 5 x 4 x resolution x resolution tensor.

Thu, Apr 19, 5:41 PM · Python, Nodes, Cycles, BF Blender
Philipp Oeser (lichtwerk) changed Type from Bug to To Do on T54314: Contents of "Viewer Node" image block do not get updated .
Thu, Apr 19, 1:30 PM · Python, Nodes, Cycles, BF Blender
Philipp Oeser (lichtwerk) claimed T54314: Contents of "Viewer Node" image block do not get updated .

Interesting problem.

Thu, Apr 19, 1:30 PM · Python, Nodes, Cycles, BF Blender
Philipp Oeser (lichtwerk) changed Type from Bug to To Do on T53768: Pixels and resolution not for multilayer EXR and Render Result.
Thu, Apr 19, 1:08 PM · Rendering, Python, BF Blender
Philipp Oeser (lichtwerk) reopened T53768: Pixels and resolution not for multilayer EXR and Render Result as "Open".

also added to TODO here: https://wiki.blender.org/index.php/Dev:Source/Development/Todo/Scripting
Will have look again if time permits

Thu, Apr 19, 1:08 PM · Rendering, Python, BF Blender

Mon, Apr 16

Aaron Carlisle (Blendify) abandoned D2711: PYAPI: Add more information to bge video texture docs.

Committed rBee2aa319821fdf8be869fc2800711d01b6350f41

Mon, Apr 16, 7:36 PM · Game Engine, Python, Documentation, BF Blender
Aaron Carlisle (Blendify) updated the summary of D3149: Manual: Remove main bge python api docs.
Mon, Apr 16, 2:24 PM · Python, Game Engine, BF Blender, Documentation
Aaron Carlisle (Blendify) added a comment to D3149: Manual: Remove main bge python api docs.

@Max Voss (max12345) the content was basically duplicated between the manual and the api docs so in rBee2aa319821fdf8be869fc2800711d01b6350f41 and rB73dfd3d38241735c7182862cd43a6fb5df6e054b I merged the two documents into the API docs. Now we will have one place to keep this information.

Mon, Apr 16, 2:10 PM · Python, Game Engine, BF Blender, Documentation
Nikolai Janakiev (paramcookie) created T54629: Incorrect qhull library called.
Mon, Apr 16, 11:34 AM · Python, BF Blender
Philipp Oeser (lichtwerk) closed T54602: Calling Text.write() in Python Script causes Blender to SegFault. as Resolved.

thx for the report, afaict, this is already fixed by rBfb3528d08870, thx @Campbell Barton (campbellbarton)!

Mon, Apr 16, 11:09 AM · Python, BF Blender
Philipp Oeser (lichtwerk) closed T54553: Blender crash on write to text data-block as Resolved.

afaict, this is also fixed by rBfb3528d08870, thx @Campbell Barton (campbellbarton)!

Mon, Apr 16, 10:57 AM · Python, BF Blender: Regressions, BF Blender
Philipp Oeser (lichtwerk) closed T54578: regression python crash modifying text block as Resolved.

afaict, this is also fixed by rBfb3528d08870, thx @Campbell Barton (campbellbarton) !

Mon, Apr 16, 10:55 AM · Python, BF Blender: Regressions, BF Blender
Max Voss (max12345) added a comment to D3149: Manual: Remove main bge python api docs.

Maybe I missed something, but why is this being done?

Mon, Apr 16, 9:29 AM · Python, Game Engine, BF Blender, Documentation

Sun, Apr 15

Aaron Carlisle (Blendify) added a comment to D3149: Manual: Remove main bge python api docs.

@Campbell Barton (campbellbarton) @Bastien Montagne (mont29) would either of you be up for 2? I can cherrypick the commits if you want but I dont have access to upload.

Sun, Apr 15, 6:07 PM · Python, Game Engine, BF Blender, Documentation
Aaron Carlisle (Blendify) created D3149: Manual: Remove main bge python api docs.
Sun, Apr 15, 6:05 PM · Python, Game Engine, BF Blender, Documentation
Campbell Barton (campbellbarton) closed T54593: Rigify crashes Blender when Generate the rig as Resolved by committing rBfb3528d08870: Fix T54593: Py text edits crash (undo regression).
Sun, Apr 15, 10:40 AM · BF Blender, BF Blender: Regressions, Python

Sat, Apr 14

Plüss Roland (dragon) updated the task description for T54602: Calling Text.write() in Python Script causes Blender to SegFault..
Sat, Apr 14, 5:49 PM · Python, BF Blender
Plüss Roland (dragon) updated the task description for T54602: Calling Text.write() in Python Script causes Blender to SegFault..
Sat, Apr 14, 5:48 PM · Python, BF Blender
Plüss Roland (dragon) created T54602: Calling Text.write() in Python Script causes Blender to SegFault..
Sat, Apr 14, 5:46 PM · Python, BF Blender

Fri, Apr 13

Philipp Oeser (lichtwerk) assigned T54593: Rigify crashes Blender when Generate the rig to Campbell Barton (campbellbarton).

Can confirm this, issue in undo. This can probably be merged into T54578, T54553?

Fri, Apr 13, 3:22 PM · BF Blender, BF Blender: Regressions, Python

Thu, Apr 12

Philipp Oeser (lichtwerk) added projects to T54553: Blender crash on write to text data-block: BF Blender: Regressions, Python.
Thu, Apr 12, 10:40 AM · Python, BF Blender: Regressions, BF Blender
Philipp Oeser (lichtwerk) added a project to T54578: regression python crash modifying text block: Python.
Thu, Apr 12, 10:40 AM · Python, BF Blender: Regressions, BF Blender

Wed, Apr 11

Amir (Warrior) added a comment to T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).

@Brecht Van Lommel (brecht) Just an update: I can get somehow around the forking issue using subprocess and doing one rendering at the time. However, the problem with using subprocess is I have to literally import everything I need from scratch. This makes the rendering much more time-consuming than doing the rendering normally. Sorry if it's too obvious that I'm just trying to convince you to prioritize this :) I hope that happens :)

Wed, Apr 11, 5:24 PM · Python, Nodes, Cycles, BF Blender
Amir (Warrior) added a comment to T54561: Import order matters: segmentation fault if PyTorch is imported before bpy.

This issue on PyTorch GitHub page might be helpful for the developers: https://github.com/pytorch/pytorch/issues/6194

Wed, Apr 11, 4:49 PM · Python, BF Blender
Amir (Warrior) added a comment to T54561: Import order matters: segmentation fault if PyTorch is imported before bpy.
Wed, Apr 11, 4:48 PM · Python, BF Blender

Tue, Apr 10

Amir (Warrior) updated the task description for T54561: Import order matters: segmentation fault if PyTorch is imported before bpy.
Tue, Apr 10, 6:01 PM · Python, BF Blender
Amir (Warrior) created T54561: Import order matters: segmentation fault if PyTorch is imported before bpy.
Tue, Apr 10, 5:59 PM · Python, BF Blender

Wed, Apr 4

Jeroen Bakker (jbakker) added a comment to T54349: Python exception typing units into a spinner that accepts units.

px is not a valid blender unit, but it is rendered to the user, hence users would expect it could be entered. Would not count this as a bug, but as an enhancement as our unit system does not support this yet. Seems to be a task for a new developer. BKE/unit.c

Wed, Apr 4, 4:59 PM · Python, BF Blender
Amir (Warrior) added a comment to T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).

@Brecht Van Lommel (brecht) I hope you will prioritize this in the future. Many people like me need to use Blender as a module for their research work. Anyways, I used gdb to get you the back trace after Python freezes. Here's what I get (I had to CTRL+C at the end):

Wed, Apr 4, 5:46 AM · Python, Nodes, Cycles, BF Blender
Brecht Van Lommel (brecht) triaged T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes) as Low priority.

This is a very low priority issue for me, since it should be quite easy to work around in the ways I suggested and the python module is not something we officially release. Given that there are many more important bugs to solve I'm not going to spend time on this now.

Wed, Apr 4, 5:01 AM · Python, Nodes, Cycles, BF Blender
Amir (Warrior) renamed T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes) from Unable to export renderings in OpenEXR when using the multiprocessing in Python (Blender freezes) to Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).
Wed, Apr 4, 4:54 AM · Python, Nodes, Cycles, BF Blender
Amir (Warrior) raised the priority of T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes) from Incomplete to Needs Triage.
Wed, Apr 4, 4:53 AM · Python, Nodes, Cycles, BF Blender
Amir (Warrior) added a comment to T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).

@Brecht Van Lommel (brecht) I'm not sure if this could be very relevant but I used OpenEXR Python bindings package to do some tests. Here's what I found out: if I have a function that simply loads an exr file and separates its channels into (R, G,B) as shown below and I execute this function via multiprocessing.Process everything works fine. However, when I just do import bpy and execute the same function via multiprocessing.Process things do not work and Python freezes. I would say this is a bug in Blender. Could you please look into this? I would really appreciate it.

Wed, Apr 4, 4:53 AM · Python, Nodes, Cycles, BF Blender

Tue, Apr 3

Brecht Van Lommel (brecht) added a comment to T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).

I would not make a bug report to the OpenEXR project, it's not clear at all there is a bug in their library and I wouldn't expect them to investigate a vague report like that. It's a possibility but too early to tell.

Tue, Apr 3, 6:54 AM · Python, Nodes, Cycles, BF Blender
Amir (Warrior) renamed T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes) from Unable to export rendering results in OpenEXR format using Python (Blender freezes) to Unable to export renderings in OpenEXR when using the multiprocessing in Python (Blender freezes).
Tue, Apr 3, 6:13 AM · Python, Nodes, Cycles, BF Blender
Amir (Warrior) added a comment to T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).

@Brecht Van Lommel (brecht) I also posted an issue on OpenEXR's GitHub repo (link here). Hopefully they can also make some clarification from their side.

Tue, Apr 3, 6:09 AM · Python, Nodes, Cycles, BF Blender
Amir (Warrior) added a comment to T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).

@Brecht Van Lommel (brecht) You said it wouldn't surprise you if some parts of Blender of OpenEXr does not work well with forking. So I wonder, which one do you think is more likely to be the case given that I can store my renderings in other formats? Would you think it's more likely that OpenEXR is the one to blame here?

Tue, Apr 3, 5:51 AM · Python, Nodes, Cycles, BF Blender

Mon, Apr 2

Amir (Warrior) added a comment to T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).

@Brecht Van Lommel (brecht) I tried with spawn but I keep getting weird errors and things do not work. It seems that I have to somehow make the process spawnable and I don't know how to do that precisely. I hope you can find a solution for this. It's so annoying for me since I have to millions of renderings and I didn't expect to do it sequentially :(

Mon, Apr 2, 9:00 PM · Python, Nodes, Cycles, BF Blender
Campbell Barton (campbellbarton) added a revision to T54272: Python API for Blender's internal image functions: D3122: Python ImBuf API.
Mon, Apr 2, 8:50 PM · BF Blender, Python
Brecht Van Lommel (brecht) added a comment to T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).

If there's another bug with OpenEXR saving unrelated to multiprocessing, another bug report can be created for that,

Mon, Apr 2, 6:31 PM · Python, Nodes, Cycles, BF Blender
Brecht Van Lommel (brecht) triaged T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes) as Incomplete priority.
Mon, Apr 2, 6:30 PM · Python, Nodes, Cycles, BF Blender
Brecht Van Lommel (brecht) added a comment to T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).

Maybe try using the spawn start method?
https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods

Mon, Apr 2, 6:28 PM · Python, Nodes, Cycles, BF Blender
Amir (Warrior) updated the task description for T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).
Mon, Apr 2, 5:52 PM · Python, Nodes, Cycles, BF Blender
Amir (Warrior) updated the task description for T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).
Mon, Apr 2, 5:33 PM · Python, Nodes, Cycles, BF Blender
Amir (Warrior) added a comment to T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).

@Brecht Van Lommel (brecht) Sorry for the missing information. I just realized that the problem is being caused if I call the rendering function using multiprocessing.Process and updated the script in my bug report that shows how exactly I do rendering in my project, with all other irrelevant details removed. The strange thing is I can easily render my meshes if I do not want the rendering result to be stored in EXR files. So, if I replace OPEN_EXR with PNG and replace 32 with 8/16 I will definitely get the rendering results stored on disk. This does not happen when trying to store the result in OpenEXR format and I did not know that the multiprocessing package might be causing it. What should I do now? Why I cannot store EXR files when using multiprocessing.Process?

Mon, Apr 2, 5:33 PM · Python, Nodes, Cycles, BF Blender
Amir (Warrior) updated the task description for T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).
Mon, Apr 2, 5:24 PM · Python, Nodes, Cycles, BF Blender
Amir (Warrior) raised the priority of T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes) from Incomplete to Needs Triage.
Mon, Apr 2, 3:53 PM · Python, Nodes, Cycles, BF Blender
Amir (Warrior) added a comment to T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).

@Brecht Van Lommel (brecht) Sorry I should have been more clear. The problem is I am compiling Blender as Python module in Ubuntu 16.04. I don't think it is possible to import the Blender module given those arguments you mentioned. Could you please double-check this as well?

Mon, Apr 2, 3:51 PM · Python, Nodes, Cycles, BF Blender

Sun, Apr 1

Brecht Van Lommel (brecht) triaged T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes) as Incomplete priority.

I can't reproduce this issue. I tried putting the above code in a test.py script with bpy.ops.render.render(write_still=True) at the end, and then running ./blender -b -P test.py.

Sun, Apr 1, 7:23 AM · Python, Nodes, Cycles, BF Blender
Amir (Warrior) updated the task description for T54461: Unable to export/import EXR files after doing `import bpy` and when using the multiprocessing in Python (Blender freezes).
Sun, Apr 1, 5:09 AM · Python, Nodes, Cycles, BF Blender