Commit Graph

106 Commits

Author SHA1 Message Date
Campbell Barton c4ce26c906 Address [#30842] Blenders Measurement Units set to Metric, makes some Precision Flaws.
use the same precision for location all over (2-5 was used), use define as 5.

also disallow boolean to have any subtype besides PROP_LAYER_MEMBER, some booleans had TRANSLATION / XYZ subtypes which don't make sense.
2012-04-10 08:33:30 +00:00
Campbell Barton 9a6a791ff0 fix [#30865] Crash when browsing last operators in outliner (or by Python API)
Operator descriptions can be NULL pointers,
fix this by making use of PROP_NEVER_NULL flag, when its not set, generated string funcs will test for NULL.
2012-04-09 04:39:47 +00:00
Campbell Barton 89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
Campbell Barton 9d49fa0e63 style cleanup - spelling corrections & update some incorrect comments. 2012-03-03 11:45:08 +00:00
Campbell Barton 2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
Campbell Barton 22b5a3735f add flag FUNC_USE_MAIN for rna functions which don't need the context. (currently unused) 2011-11-17 18:41:37 +00:00
Campbell Barton d6c1009195 bytestring support for py/rna - this is so py can access data which
isn't meant to be accessed as unicode text.
2011-11-15 07:09:41 +00:00
Campbell Barton ce462fa1b7 - disable undo for user preferences (every click would do push an undo), was noticeable on large files.
- also netbeans project file generator now uses branch name for project.
2011-11-08 15:11:27 +00:00
Campbell Barton 4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Campbell Barton b001eeb10d Change struct alignment for structs which are intended to be aligned but aren't.
remove uiIconImage too since its unused.
2011-10-03 01:36:25 +00:00
Campbell Barton 943a026c60 py/rna string subtypes for strings which should be automatically translated:
layout.prop("blah", text="Translate Me!")
2011-09-21 13:53:35 +00:00
Lukas Toenne 8e0fe8bff7 Merged the particles-2010 branch with node improvements into trunk.
This branch adds mostly organizational improvements to the node system by renaming the node folders and files. A couple of internal features have been added too.
Detailed information can be found on the wiki page:

http://wiki.blender.org/index.php/User:Phonybone/Particles2010
2011-09-05 21:01:50 +00:00
Campbell Barton 2c8e1e633c comment unused lines. 2011-08-15 03:41:31 +00:00
Campbell Barton 9c8cc9fe60 rna option not to save certain properties for redoing later, currently only used by operator presets. 2011-06-07 10:54:57 +00:00
Campbell Barton 8cee328546 Support for update callbacks in python defined RNA properties as discussed last meeting.
This means script authors can perform actions using these callbacks rather then on drawing which puts blender in a readonly state.

Simple example:

import bpy
def up_func(self, context):
    print("test")

bpy.types.Scene.testprop = bpy.props.FloatProperty(update=up_func)
bpy.context.scene.testprop = 11

# prints -> test
2011-06-06 17:50:20 +00:00
Campbell Barton 155d589333 add the property as an argument to enum item functions, not used yet but needed for dynamic python enums. 2011-05-26 13:38:16 +00:00
Brecht Van Lommel 66f51ba5d1 RNA: make mechanism used by operators to keep python instance alive more generic, to be used by render engine later. 2011-05-18 11:21:10 +00:00
Brecht Van Lommel 178ba76b09 RNA: pass Main rather than Context to register/unregister callbacks. 2011-05-18 10:56:26 +00:00
Campbell Barton 70cd0803ab add new subtype PROP_COORDS, for generic coordinates that are not to be changed by units. 2011-04-08 13:32:56 +00:00
Brecht Van Lommel 128bed8480 RNA: use a different method to set DNA types for BlendData* collections, to
solve issues with c++ api.
2011-03-13 13:01:02 +00:00
Nathan Letwory a47ca06502 doxygen: blender/makesrna tagged. 2011-02-27 20:20:01 +00:00
Nathan Letwory 5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00
Campbell Barton 8ea0b4685c misc small changes:
- rename rna collection structs Main prefix to BlendData: eg, MainObjects --> BlendDataObjects
- printing python collection now prints its type (when available)
- renamed shadowed vars in bpy_rna.c.
- when making functions static I also made debugging/test functions static, reverse and add definitions to headers instead.
2011-02-14 03:15:55 +00:00
Campbell Barton daa09a4a60 Raise an exception when registering classes with ID names which are too long. (related to bug ), found while looking into bug [#25776]. 2011-01-24 03:38:34 +00:00
Campbell Barton 86bbab7de5 remove/comment unused defines. 2011-01-15 16:14:57 +00:00
Campbell Barton 9733e5f76f revert part of Tons commit r33884.
- rather then use unlink="None", just don't pass unlink as a keyword. This is more pythonic.
- added an RNA flag for properties which cant be unlinked by setting to None.
2010-12-30 12:22:28 +00:00
Campbell Barton d624d1cbdd pass along the context to extension functions, this was already being done in all cases except for the render engine.
this allows python to NULL its internal context while scripts are not running.
2010-12-07 04:12:15 +00:00
Campbell Barton b45c3363fd fix for some pedantic warnings. 2010-12-03 01:52:28 +00:00
Campbell Barton ee1d2adc16 partial fix for [#23532]
- Python calling operators didn't run WM_operator_properties_sanitize() so enum functions called from python were given a NULL context.
- PROP_ENUM_NO_CONTEXT and PROP_NEVER_NULL used the same value in the enum (possible conflict).
2010-11-23 12:05:35 +00:00
Campbell Barton dfb8c5974e rna support for passing dynamic sized arrays to rna functions
using this for object.vertex_groups.assign([index list ...], group, weight, mode)
2010-08-31 11:31:21 +00:00
Campbell Barton 4e3390437e - Properties from base classes are now registered too, this allows class mix-in's to define properties.
An example of how this is useful - an importer mixin could define the filepath properties and a generic invoke function which can run the subclasses exec for each selected file.

- Panels and Menus now skip the property check when registering.

- renamed _idproperties_ to _idprops_ in function names, function names were getting very long.
2010-08-19 10:16:30 +00:00
Nicholas Bishop 63791e03d6 * Partially revert r30763, where PROP_IMAGEPATH was added.
* Brush icon property back to not using image browser until a better solution is decided on.
2010-07-26 23:40:46 +00:00
Nicholas Bishop 8fb499c34f * Added a new RNA subtype, PROP_IMAGEPATH. It's the same as PROP_FILEPATH, but for images only.
* Changed UI code to display image browser for PROP_IMAGEPATH
* Set the icon_filepath RNA property for brushes to use PROP_IMAGEPATH
* Changed preview icon drawing to ignore unset icons
* Fixed const warnings in brush RNA
2010-07-26 18:37:47 +00:00
Campbell Barton 556b57febf get rid of some warnings,
removed NG_LoopBackNetworkDeviceInterface::GetNetworkVersion(), wasnt used anywhere.
2010-06-05 15:31:55 +00:00
Campbell Barton b9662fc637 patch from Dan Eicher
- pose markers new/remove
- font load/remove
- world load/remove
- particles new/remove

commented out node-tree for now since from what I can tell these have to be atteched to material/scene/texture (unlike other ID types)
2010-05-15 13:30:14 +00:00
Campbell Barton cd6332ca1e patch from Dan Eicher
rna add/remove functions for lattices, brushes and metaballs
2010-05-14 21:16:37 +00:00
Brecht Van Lommel 9a85013692 Merge various small changes from render branch:
* Division by zero fix for TNT SVD code.
* Sound fix, in case ffmpeg decode fails, don't use the samples.
* Fix for incorrect bounds of transformed objects in new raytracing code.
* Gave memory arena's a name used for allocations for easier memory
  usage debugging.
* Dupligroup no_draw option was using layers but not restrict view/render
  setting. (not a bugfix exactly but would do display list context switching
  while drawing for no reason).
* Fix objects instanced on hair particles not giving consistent results
  when the object is transformed.
* New math functions: madd_v4_v4fl, len_squared_v3v3, interp_v4_v4v4v4,
  mul_v4_m4v4, SH and form factor functions, box_minmax_bounds_m4.
* mul_m4_m4m4 and mul_m3_m3m3 now accept the same pointers for multiple
  arguments.
* endjob callback for WM jobs system.
* Geometry node uv/color layer now has search list/autocomplete.
* Various small buildsystem tweaks, not strictly needed yet in trunk.
2010-04-15 10:28:32 +00:00
Brecht Van Lommel 5bc2d53507 fix for parsing python args to rna functions, was using allocated size as argument count.
(commit 27670 by Campbell from render25 branch)
2010-03-23 15:04:06 +00:00
Brecht Van Lommel 33e0ea0e59 py/rna functions for adding and removing curve data.
(commit 27666 by Campbell from render25 branch)
2010-03-23 14:58:36 +00:00
Campbell Barton 391cc2d004 merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
Campbell Barton 081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Campbell Barton ecaa50ed7b PROP_ANIMATEABLE -> PROP_ANIMATABLE (more common spelling) 2010-02-02 00:02:55 +00:00
Campbell Barton 039d087171 subtype support for properties in bpy.props. 2010-02-01 22:04:33 +00:00
Martin Poirier fb7878a2c2 PROP_ENUM_NO_CONTEXT flag for rna properties, forcing enum item functions to be passed a null context (to return non-contextual items).
This is set on keymap item operator properties and macro definition operator properties to make them non-contextual (since the context at definition time is most likely not the same then at execution time, it's better to have all options visible).

This removes some more errors in keymap export and import.

This commit also sanitize some enum item function, making sure they can cope with null context and have usable defaults in that case.
2010-01-27 21:19:39 +00:00
Elia Sarti 9733e902a5 RNA functions
Fixed and completed support for returning multiple values. This includes support for returning arrays, both fixed and dynamically sized. The way this is achieved is by storing an additional int value next to the dynamic parameter in the ParameterList stack which gets passed to the C function as an additional parameter. In the case of return parameters it is duty of the C function to set this int to the correct length value for the dynamic parameter (which makes sense). Note that for the dynamic output/return parameter it is assumed the function has allocated that memory (which gets freed automatically).

Also, I cleaned the makesrna's bridge function generation code a bit and renamed PROP_RETURN to PROP_OUTPUT, which represents better the reality now that there are multiple returns. The function now to mark multiple returns (outputs) is RNA_def_function_output.

For an example, look at Action.get_frame_range in rna_action_api.c, by the way Aligorith I removed the #ifdef for this function now that there's support for returning arrays, feel free to modify (the function seems to work).
2010-01-24 10:51:59 +00:00
Brecht Van Lommel 00318eaa2e RNA: added option to pass self ID to RNA functions. 2010-01-22 10:58:02 +00:00
Campbell Barton c7dfa96aea bugfix [#20639] BF25_SVN_25888 and below - OBJ and 3DS import fails
blender supports type changing for textures in a way that python doesnt.
add a new general function.

Example usage:
 tex = bpy.data.textures.new("Foo")
 tex.type = 'IMAGE'
 tex = tex.recast_type()

Macro to give the number of users accounting for fake user.
 ID_REAL_USERS(id)
Use this so you can remove a datablock if it has a fake users as well as apply transformations to it in the 3D view.

Move api function bpy.data.add_texture() --> bpy.data.textures.new()/remove()
2010-01-17 20:06:34 +00:00
Campbell Barton 689450a8f1 rna/py api
bpy.data.groups.new()/remove()
bpy.data.actions.new()/remove()
2010-01-11 23:40:01 +00:00
Campbell Barton b6a1bc575b rna/py api
bpy.data.scenes.remove(scene) # now works without crashing
bpy.data.texts.new(name)/remove(text)/load(path) # added
2010-01-11 00:41:31 +00:00
Campbell Barton 3b03984294 Change how 'Main' collection type definitons work so that 'self' can be used without overriding the srna type. 2010-01-10 15:20:22 +00:00