[Bf-python] Extra functionality proposals

Kesten Broughton solarmobiletrailers at gmail.com
Sat Nov 19 16:34:29 CET 2011


I've been looking at the object.ray_cast c++ code and would like to do some
work on it.  Bolsee and Erwin were in charge, but I believe neither is
currently working on game engine code and I can't get in touch with either
of them by email.

If you run into any problems completing work at the python level
perhaps you could submit this as a feature request
http://wiki.blender.org/index.php/Dev:Ref/Requests
with a little more fleshed out, maybe even some pictures as a full fledged
requirements document that i can follow.  I'd be happy to work on it with
you.

ray_cast can be fairly intensive, so make sure you're doing some
performance testing with the print-debug on-screen to watch the physics.

also, would an option that allows you to ray-cast a tube (cylinder) of
specified radius be useful to you?

kesten


On Sat, Nov 19, 2011 at 1:56 AM, Dima Glibitsky <dima.glib at gmail.com> wrote:

> I propose to add the following functionalities:
>
> * A variant of object.ray_cast that returns all intersections, not
> just the closest one.
> Examples where this can be beneficial:
> - determining whether a point is inside or outside a mesh
> - determining thickness/gaps in the given direction
> - filter intersection results (e.g. consider only frontfacing
> polygons, ignore polygons with transparent material, etc.)
>
> * A mechanism to temporarily freeze undo history.
> Currently there is no way for scripts to get up-to-date mesh data
> while it is in editmode. Scripts can toggle editmode, but that has a
> nasty consequence of modifying the undo history... The situation may
> change with the arrival of BMesh, but, even then, freezing history
> could still be useful for some other cases I don't know of.
> On the Python level, I suggest it to be implemented as a context manager:
> [CODE]
> with bpy.utils.freeze_undo_history():
>    # ... Do some sneaky operations. Don't forget to return everything
> to where it was!
> # At this point, undo history is the same it was before
> freeze_undo_history().
> [/CODE]
>
> * UILayout method to display "fake" ID datablock selectors.
> This would be useful for the situations when a script wants to present
> a custom dynamic list of selectable (and, possibly, renamable)
> elements:
> - choosing an object from the custom-filtered list (e.g. from objects
> which have custom property that satisfies some condition)
> - defining and working with custom libraries of domain-specific
> objects (operator presets, game object templates, bookmarked cursor
> positions, etc.)
>
> Example signature:
> UILayout.prop_collection_selector(data, property, name_property,
> search_data, search_property, search_icon='NONE', add_op=None,
> add_icon=None, remove_op=None, remove_icon=None, allow_rename=True)
>
> data -- object from which to take collection
> property -- identifier of the corresponding CollectionProperty member
> name_property -- identifier of item's StringProperty, which has the
> semantics of unique item's name
> search_data -- object that stores active (selected) collection element
> search_property -- identifier of the corresponding StringProperty
> member; has the semantics of active element's name
> search_icon -- icon for drop-down selector
> add_op -- operator for adding items to collection
> add_icon -- add_op icon
> remove_op -- operator for removing items from collection
> remove_icon -- add_op icon
> allow_rename -- if False, the name won't be editable (like in Enum
> selector)
>
> Also, any conflicting names should be automatically renamed, like
> everywhere else in Blender.
>
> Another solution is to introduce a special kind of Property for such
> cases (e.g. CustomIDBlockProperty).
>
> ------------------------
> dairin0d
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>



-- 

Kesten Broughton
President and Technology Director,
Solar Mobile Trailers
kesten at solarmobiletrailers.com
www.sunfarmkitchens.ca <http://www.sunfarmkitchens.ca>
512 701 4209
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20111119/c06c4106/attachment.html>


More information about the Bf-python mailing list