Commit Graph

1738 Commits

Author SHA1 Message Date
086e8b9b8f Bugfix [#8328] Python scripts from user defined location doesn't load
http://projects.blender.org/tracker/index.php?func=detail&aid=8328&group_id=9&atid=125

last commit had mistakes but tested this to fix the bug.
- Cam
2008-02-27 10:02:40 +00:00
b226eb925b should fix bug on win32 with user python menu's not loading because stat() didnt like the trailing slash and returned the dir as missing. 2008-02-27 09:48:43 +00:00
2089ac3091 == BPython ==
Another experiment to support threading properly. By default the Python Interpreter releases its lock every 100 instructions so that other threads get a chance to run Python code and API calls. But that is not enough to prevent race conditions causing artifacts (and maybe crashes) during threaded rendering, since all threads will access the same pynodes data.

So I'm disabling this automatic releasing of the lock (the GIL) by the interpreter, which seems to be a better option for how Blender uses Python.
2008-02-26 17:23:56 +00:00
3dd622b2b4 Added PyGILState_Ensure and PyGILState_Release funcs around module reloading.
Without them blender would crash when reloading scripts.
2008-02-25 18:35:35 +00:00
d4fface140 Fix for bug #8081: python script crash writing MFace.uv. 2008-02-25 11:55:51 +00:00
3023458aa7 Purge of compiler warnings (number 2):
* initial values I added in radialcontrol.c might need to be reviewed if they cause problems(I used 200, as it seems many tools were setting that)
* #pragma warnings are the only warnings I still get, so that means we have a clean slate again
2008-02-25 04:38:48 +00:00
18df3388a4 == BPython ==
[#8354] Blender or Python25.dll crash on... quit, reported by David B. (myvain)

The BPy_FreeButtonsList() function is also called after we call Py_Finalize(). Calling PyGILState_Ensure()/Release() there crashes Blender. Added a test to prevent this, but note that function still runs Python API code to free a buttons list. Doesn't seem to give problems, though. Thanks, David.
2008-02-25 01:35:50 +00:00
87dd4809ed == PyNodes ==
Small update to where a PyGILState_Ensure() call is made.

--

Let me use this commit to mention a couple things related to this change to make Python thread-safe in Blender:

1) This page explains the changes: http://wiki.blender.org/index.php/BlenderDev/BPythonAPI/Threads

2) If you experience hangs (deadlocks) when running anything related to Python in Blender, the related part in the code may need a proper Ensure/Release block, as explained in the above link.

From Joshua (aligorith)'s previous commit to this file:

"* various problems related to gilstate calls being added in strange places (could someone familiar with python double check that they're in the right places now)?"

I checked the two places you fixed, second one is ok, the first one needed to be before the call to create a py dict -- done. Thanks for catching them!
2008-02-24 16:19:39 +00:00
54f83a423a Purge of warnings from BPY_interface.c
* missing include for depsgraph from previous commit
* various problems related to gilstate calls being added in strange places (could someone familiar with python double check that they're in the right places now)?
2008-02-24 10:36:19 +00:00
cd934aa1a8 Patch #8344:
Submitted by: Thomas Knight (epat)

Parts committed:
1) Fixed a few misspellings in some error strings.
2) Fixed a (theoretical) bug with pyconstraints where a text object could be deleted from python but would remain linked
to the constraint it was assigned to - causing slight UI usage discontinuities!

Not committed yet:
3) Particle system bugfix in this patch has not been committed. Could jahka or brecht check this.
2008-02-24 06:38:42 +00:00
Nathan Letwory
012f0a336c === PyNodes ===
* Make PyNodes work with threaded renderer. This patch is by Willian. He has worked hard on getting this sorted out - now you should be able to render with PyNodes AND multiple threads.
2008-02-23 12:05:28 +00:00
f312611a92 =ID Property Bugfix=
There was an extraneous line causing ID property groups
to have the wrong length, causing crashes in code that
relied on it.

This commit both fixes that and adds a version check to
fix group lengths for older .blends.  The subversion
was incremented to 15 for this change.
2008-02-23 02:12:50 +00:00
0e935e397b * Displacement baking wasnt working with negative distances.
* Added Normalize option for diplacement so everything in the 'Dist' range is mapped 0-1
* Increased the maximum Dist and Bias to1000.0 (was 10.0)
* Added python utility function in BPyRender.py - bakeToPlane(...), to automate heightmap, normalmap generation for Crystalspace.
2008-02-22 14:27:46 +00:00
4dbf6cf204 adding access to missing bake variables from python 2008-02-22 10:50:45 +00:00
7c7a931fed made auto threads default (noob's get faster renders in their dual core CPU's)
changed env variable check order $TMP, $TMPDIR - aparently $TMP is more common.
2008-02-21 08:43:13 +00:00
4c0b33ef80 Python Bugfix
A new file could have its Blender.Get("filename") return "<memory>" after undo'ing on an open file.
Fix for own error with python sys.path, messed up game engine.
2008-02-20 18:56:07 +00:00
cf27a896fa Python Bugfix,
Setting the user preference for python scripts didnt add the bpymodules subdirectory to sys.path (python module search path).
Also problems with entering and exiting- the old path was used until next restart.
2008-02-20 13:42:15 +00:00
0d80e08e8a python API: added support for screen font 12(fix-width) as "normalfix" 2008-02-19 10:47:29 +00:00
417687c4ff Bugfix: yafray number of processors was not properly initialized, and
could be 0, hanging yafray. This commits removes the separate yafray
number of processor setting and simply using the blender threads
button, there is no reason for a separate setting.
2008-02-17 22:11:05 +00:00
b7af3d2cbd fix for [#8257] double-freeing pointers from sculpt code
http://projects.blender.org/tracker/index.php?func=detail&aid=8257&group_id=9&atid=125

Cleaned up scene_copy, and moved some scene copying into this function that was inline in the user interface.

Also moved malloc error prints onto separate lines so you can set breakpoints.
2008-02-16 16:35:47 +00:00
11c926b575 Python api addition PupTreeMenu() - for apricot 2008-02-15 16:08:41 +00:00
b58274abef == BPython API ==
Fixing mistake in Blender_ShowHelp() function: argument to Blender_Run() should be passed directly as a string, not encapsulated in a tuple (aka "s", not "(s)").
2008-02-13 20:42:36 +00:00
bc9848f7e6 Added a global string to be used for the tempdir. since the user preference is not loaded in background mode and the user preference is not validated and has no fallback.
'btempdir' is set with BLI_where_is_temp() - This tries to use U.tempdir but falls back to $TEMP or /tmp/
2008-02-13 13:55:22 +00:00
Ken Hughes
60378a306c Python API
----------
Added missing lamp.falloffType attribute.  Also fixed typo in Render docs.
2008-02-12 19:29:12 +00:00
3974a0a3c1 Added python access for baking
http://www.blender.org/documentation/246PythonDoc/
http://www.blender.org/documentation/246PythonDoc/Render.RenderData-class.html
http://www.blender.org/documentation/246PythonDoc/bpy_api_2_46.zip
2008-02-12 14:47:55 +00:00
f33faa8f5f python scriptlink for ObjectUpdate and ObDataUpdate, Redraw events are not practice in many real world cases, this can give more specific updates.
Discussed with Caedes, Brecht and Ton, can rework if needed.
2008-02-11 12:01:14 +00:00
9615532ccb == Pynodes ==
1) Trying to bring back compatibility with Python2.3.
2) Adding some stubs to compile blender player again on linux.

Please tell me if Blender still doesn't compile with py 2.3 or if the player isn't compiling. There was a binreloc related stub I needed to add, so probably the player wasn't compiling before the pynodes commit.

Thanks PanzerMKZ for reporting and testing part of the fix to py 2.3.
2008-02-10 21:12:44 +00:00
Nathan Letwory
9d7ef684e3 * remove redundant define. 2008-02-10 18:48:29 +00:00
34ddfb03c1 == BPy: scripts in menus ==
Fixing compile warning (about a var that was always true being used as condition in an "if" block).
2008-02-10 02:12:06 +00:00
Nathan Letwory
16514e3ddb * Merge of PyNodes to trunk. Finally!
See http://wiki.blender.org/index.php/BlenderDev/PyNodes and
  http://wiki.blender.org/index.php/BlenderDev/PyNodes/API
  For current documentation.

  Very very big thanks go to William Germano for fixing the memory issues left
  and for improving on the code.

  In the coming time documentation will be finalised and further stabilising
  of PyNodes is to be expected.
2008-02-09 23:17:15 +00:00
abb2d6b3eb This is patch: [#8244] Add MultiLayer image type in python API documentation
Submitted By: Stephane SOPPERA (soppera)

Just updates the docs for previous commit.

Kent
2008-02-06 22:35:48 +00:00
37d139ea54 This is patch: [#8228] Add MultiLayer image type to python and batch rendering
Submitted By: Stephane SOPPERA (soppera)

Also fixes a small typo with wrong filetype for TIFF commandline rendering.

Kent
2008-02-05 19:31:21 +00:00
9c12534cd9 Python API
----------
Correct sound into font in documentation to api2_2x/doc/Font.py.
2008-02-04 00:44:31 +00:00
Ken Hughes
87fbe307a1 Python API
----------
renderData.removeRenderLayer() was not returning a Python object; make it
return None;
2008-02-03 01:30:15 +00:00
07ccea0ac2 == Python API - Mesh ==
This patch by Domino Maram adds the function addMultiresLevel
2008-02-02 23:58:05 +00:00
fdab7b08f1 remoed testing line 2008-02-02 04:10:31 +00:00
655ca9d9ae makefile was not adding openexr, so py api never enabled setting openexr image type when using make. 2008-02-02 03:23:36 +00:00
86cbb9f7cb PyConstraint Bugfix:
Uncommented armature weakrefs stuff for PyConstraints. This should fix some erratic error messages a user found with these a few months ago.
2008-01-30 09:29:40 +00:00
31a1590db0 Bugfix: quaternion angle calculation in python used the acos function.
This gives nan if the input is e.g. 1.00000001 due to rounding errors,
better is to use saacos (safe acos) that checks for the range first.
2008-01-29 09:44:26 +00:00
b115bd677b some bugs with previous renderlayer api 2008-01-28 00:07:59 +00:00
5e512afa0a renderLayer access for the render api, no epydocs yet 2008-01-27 22:22:41 +00:00
78cedbd1f9 added function to get the full path for a rendered frame (before its rendered) 2008-01-26 15:38:06 +00:00
0adafe923a Fixed small typo... This is [#8138] Tiny typo
Kent
2008-01-23 15:51:25 +00:00
c089564faf openexr, touch and noOverwrite setting access from py api 2008-01-23 14:15:34 +00:00
Ken Hughes
b778daed81 Python API
----------
Correct error in LibData module documentation.
2008-01-22 05:45:09 +00:00
f417989871 Made it so locked strips inside metastrips are transformed.
Removed FTYPE from render output panel - was some old format that did index colors, and wasn't even used anywhere.

Added 2 options to the render output panel that can be used for a really basic local renderfarm (even artists can use it!),
"NoOverwrite" and "Touch"
When both are enabled, rendering 1 scene between many pc's on a fast network will populate the directory with frames.
Also useful to delete frames that have errors and re-render (without manually re-rendering each frame)
2008-01-20 17:53:58 +00:00
d450dbec91 add the option to add the parents time offset value. 2008-01-19 16:32:29 +00:00
7b6c88473c find_group would only return the first group, this let to the assumption that an object was only in 1 group, made it easy to loop through all groups an object is in.
group = NULL;
while( (group = find_group(base->object, group)) ) {
	...
}
2008-01-19 15:13:42 +00:00
Ken Hughes
f41c3340be Python API
----------
Added RenderData.activeLayer attribute, lets user access the active
rendering layer.  Also corrected description of RenderData.freeImages
attribute.

Note: doesn't seem like there is any support in the python API for accessing
the renderlayers settings....
2008-01-16 03:02:54 +00:00
7f0e7b8e16 incorrect epydocs 2008-01-15 17:37:47 +00:00