Commit Graph

1777 Commits

Author SHA1 Message Date
Ken Hughes
2976a38fd9 Python API
----------
Bugfix #8615: NMesh.update() did not check if faces had less than 3 vertices, so would create bogus faces.  

Also discovered in the process that documentation and error message for Mesh.assignVertsToGroup() was wrong.
2008-03-26 17:29:20 +00:00
662c57d63e fix for [bf-blender-Bug Tracker][8739] image selector never exits.
This fix was made to the file selector weren't applied to the image selector.
Made file and image selector use same python api function.
2008-03-25 09:00:00 +00:00
1930a925c8 Removing some compiler warnings.
(Note to who-ever made all the changes referring to r.scemode:
r.scemode is an int, not a short!)
2008-03-21 23:10:23 +00:00
Ken Hughes
3c7308614a Python API
----------
Bugfix #6543: Blender.Library.Load() could segfault if called more than once
with a library of different endian type.  In the process discovered an
invalid memory reference in other another function calling library_append().
Thanks to Brecht for the pointers on tracking this old bug down.
2008-03-20 04:59:59 +00:00
6222b1ca99 saveRenderedImage dosnt work in backgrond mode, so added a warning in the docs and an exception if called. 2008-03-19 10:37:19 +00:00
66374761e1 added a warning in python api abot ipo curves. minor change to curve.c 2008-03-19 09:26:01 +00:00
f47aec78c9 fix for [#7962] anomalous mem usage with pydrivers.py scripts 2008-03-18 14:49:31 +00:00
b10726a2ad patch from Paul Rotering (pryon)
[#7124] knot vector access for SurfNurb
2008-03-18 13:42:38 +00:00
bc7b18131b Running scripts with Blender.Run() would crash when reloading. 2008-03-17 19:58:11 +00:00
aee5cb7762 - [#8589] Scripts which use file selector not working correctly
Fix for another bug I introduced with persistent python windows.
also removed unused var.
2008-03-17 18:01:59 +00:00
f96064d33c missing header 2008-03-17 16:45:20 +00:00
dae503187c == PyNodes ==
Ongoing updates to the Blender.Node Python API:

- Changed Blender.Node.node to Blender.Node.Scripted to be more specific and conform to bpython API.
- Added a Blender.Node.Socket type to be used to define node sockets in a PyNode script. Also, socket type is inferred from the value(s) passed in, instead of also being defined by the script author.
- Added attr access to input and output sockets in the __call__ method. Ex: an input socket called 'color' can be accessed as self.input.color now.

These changes break existing pynode scripts, which shouldn't be a problem yet, of course, since we're still finishing this feature for 2.46. The wiki page and sample .blends have already been updated:

http://wiki.blender.org/index.php/BlenderDev/PyNodes
http://wiki.blender.org/index.php/BlenderDev/PyNodes/API
2008-03-16 17:24:29 +00:00
26daad49a3 [8559] Python script that uses FIleSelector and has an error in it segfaults Blender
Want completely fixed, check if the script was removed before running the callback.
2008-03-16 14:28:00 +00:00
87c54fb784 Constraints PyAPI:
Added support for Limit Distance constraint
2008-03-16 10:26:13 +00:00
eab07f7322 Constraints Py-Api:
Fixed up Py-API access to PyConstraints. Also updated docs to reflect these changes.
2008-03-16 06:28:40 +00:00
a5d31fc28e fix for [#8559] Python script that uses FIleSelector and has an error in it segfaults Blender 2008-03-15 18:53:42 +00:00
02295c491f forgot to free memory for python api mesh.getTangents() 2008-03-15 17:19:53 +00:00
f70d9ceed0 fix bug in walking through script linked list (thanks VS) 2008-03-15 16:49:22 +00:00
8e126216b0 added mesh.getTangents() to the python api 2008-03-14 18:53:51 +00:00
af93553640 Moved recent addition of get/setPixelF to get/setPixelHDR and kept get/setPixelF limited to 0.0-1.0 range, to prevent existing scripts breaking. 2008-03-12 11:13:57 +00:00
c8d9d60a99 Added python access to TEXFACE_ALPHA 2008-03-12 09:04:07 +00:00
51a8a60d96 Bugfixes:
* Menus could no longer have their items accessed by number (i.e. W-5 didn't run merge tool in EditMode when accessed by keyboard). This was caused by my commit for BUTM (there was some extra code there that isn't really needed, but was causing havok). 
* NumPad can now be used for the above feature too now
* Typo in error message in Constraints PyAPI
2008-03-11 11:22:27 +00:00
294f884a7d fix for cam.setScale(), cam.setClipStart(), cam.setClipEnd() and
cam.setDrawSize(), they would raise errors when setting ints. but used not to.
better tooltips for Uv Stretch
2008-03-11 09:00:09 +00:00
2b42733105 Applied [#7076] Updated Python Image API to use float buffers in getPixelF/setPixelF
and added an image.updateDisplay() function to update imbuf->rect from imbuf->rect_float
also corrected some docstrings and epydocs
2008-03-10 12:17:58 +00:00
d9da14d8a7 fix for uninitialized variables in uv stretch drawing,
[#8428] 'Editmesh_active' theme colour not accessible via Python
bugfix problem where saving a theme would raise and error when ~/.blender didnt exist.
bugfix for file selector staying open (introduced with own undo resistant scripts)
2008-03-09 07:35:12 +00:00
b13cd8226e Bugfix #8478: Constraints PyApi for setting targetspace non-functional
Finishing off some unfinished business (from the multi-target constraints work), it is now possible to get/set target-space for constraints where this is relevant. 

For this to be possible, target-space setting(s) are now always presented as a list of ints, with each int representing the target-space setting for the relevant target. 

Constraints C-API note:
get_targets function now needs to return the number of targets the constraint can have
2008-03-08 02:16:37 +00:00
f13dc2aac1 snap menu order change, as suggested by Theeth, fix for own error with Window.TestBreak() 2008-03-07 09:33:18 +00:00
b4e13ae575 Another big purge of warnings. (Main culprits this time were Campbell and Geoffrey):
* no newline at end of file (2-3)
* uninitialised vars (1)
* unused vars (1-2)
* assigning/comparing pointers and ints (numerous)
* etc.
2008-03-07 03:24:23 +00:00
955e1b7ba0 PyAPI - Window.TestBreak() - True if the user pressed escape. 2008-03-06 22:45:11 +00:00
Ken Hughes
ff63ac4bcd Python API
----------
Bugfix #8472: texture.image setter did not accept None to remove an image, or
set the image type once an image was assigned.
2008-03-06 21:43:22 +00:00
08f306c81c Made python scripts save and load in the blend file so you can have the same scripts running when you open a blend file.
Also scripts will re-run on undo rather then closing.

This is done by saving and loading the name of the script or textblock of the 'Script' datablock, connected to the ScriptSpace. This way when there is a name but the script dosnt run.
Blender runs the script or text block if available.
2008-03-06 21:25:15 +00:00
c7d0a2a92a PyAPI: create scene sequence data if its not there when getting scene.sequence 2008-03-03 21:43:31 +00:00
7af9e824bf * Bugfix #8426: certain hooks options segfaulted
This was caused by my previous commit for add_hook.

* Also, removed a compiler warning in the Python code
2008-03-03 03:21:25 +00:00
62584d78eb Py API - rename UndoPush to SaveUndoState 2008-03-02 15:57:19 +00:00
Nathan Letwory
3ee29c00ed * temproary -> temporary topy fxi 2008-03-02 08:49:39 +00:00
d1af95f4bb Fix for bug [#8405] makeParentDeform segfaults Blender
linking armatures to objects didnt make pose data.
2008-03-01 10:59:38 +00:00
a30b582300 Removed warning from py-api code 2008-03-01 03:42:09 +00:00
a577bb9fc8 Wrap UndoPush with python, needed for apricot, so changes made be scripts can have undo's as well, otherwise users undo and loose changes the script made. 2008-02-29 20:45:57 +00:00
cbf278246f Fix for bug: cross platform strand render differences with kink/branch.
This time is was due to different accuracy of floating point computation,
now it uses does a comparison a bit different to avoid this.

Also changed the vectoquat function to be threadsafe.
2008-02-27 14:17:32 +00:00
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