Object: Fracture tools
Closed, ArchivedPublic

Description

Project: Blender Extensions
Tracker: Py Scripts Release
Blender: 2.64
Python: 3.2
Script name: Object: Fracture Tools
Homepage: http://blenderartists.org/forum/showthread.php?t=181391
Wiki page: http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/Object/Fracture
Author(s): pildanovak (vilda)
Category: Object
SVN Download: https://svn.blender.org/svnroot/bf-extensions/trunk/py/scripts/addons/object_fracture/
Status: Open

Short tutorial:
1.Download and install extension. go to preferences->addons>install, find the .zip file(do not unpack it yourself, installer does). Then enable the Fracture extension.
2. create a manifold mesh(cube), space-search fracture object operator, run it.
3. Tweak the operator properties in the last operator area. then check execute. The operator tweaking isn't possible since that point. If you set up a lot of shards, you'll have to wait.
4. select all the shards you want to take part in explosion. Then search and run the Setup shards operator.
5. run these 2 operators: Add rigidbody recorder, Add bomb.
6. you can place the bomb whereever you want, and tweak it's properties in the logic window. prop names should be self explanatory.
7. Select the shards.
8. Run the game engine.
9. After leaving engine, your animation should be baked.

Notes:
there is allready game engine recording feature in 2.5, so theoretically this could be redone to not use the recorder, but now you have to use it because it also freezes objects in the beginning. I also consider the possibility to re-bake just the selected shards much better than baking all rigidbodies in the scene...
No projectile or 'active shard' feature from 2.49, not possible with 2.5 now.
Also no 2d version(no acces to images from rna yet ), no voronoi yet e.t.c. I have now very few time for this, so anybody wanting to play with the code is welcome. It's very simple, just few lines of code!

meta-androcto (Brendon Murphy) set Type to Other.Via Old WorldMar 27 2010, 12:53 PM
pontiac (Martin Buerbaum) added a comment.Via Old WorldApr 13 2010, 11:37 AM

Fixed archive fracture.zip
* Converted the .rar into a .zip file
* Removed unnecessary files inside (.blend1, .blend2 ~ backup files and .pyc)
* Fixed for API changes (Mathutils -> mathutils)

fracture.rar is obsolete

pontiac (Martin Buerbaum) added a comment.Via Old WorldApr 13 2010, 12:15 PM

New fracture.zip
* Fixed problem with create_mesh() (API change: needs a scene as first parameter)
* Made the scripts PEP8 compatible and cleaned up the code a bit.

pontiac (Martin Buerbaum) added a comment.Via Old WorldApr 13 2010, 4:54 PM

The script is available in bf-extensions trunk now (r562++).

dmlr7 (giovanni leon) added a comment.Via Old WorldSep 1 2010, 4:54 AM

in version 2.0 script return errors
in ubuntu 10.04, with http://ppa.launchpad.net/cheleb/blender-svn/ubuntu for download blender and addons

testscreenings (Florian Meyer) added a comment.Via Old WorldDec 23 2010, 5:32 PM

- marked as no wiki
wikipage is there but massively incomplete.

markus-k (Markus Kasten) added a comment.Via Old WorldApr 10 2011, 9:36 PM

I fixed errors in bomb and recorder script, caused by the Python API changes. It should work with Blender 2.56.6 now.

meta-androcto (Brendon Murphy) added a comment.Via Old WorldApr 14 2011, 11:20 PM

Reported & confirmed broken in Release 2.57

mont29 (Bastien Montagne) added a comment.Via Old WorldApr 15 2011, 12:08 AM

I think I found and fixed the problem – was line 217 in fracture_ops.py
Attached the fixed (I hope) version.

mont29 (Bastien Montagne) added a comment.Via Old WorldApr 15 2011, 10:08 AM

Bah, in fact, there are other problems as well – will try to check all today…

michaelw (michael williamson) added a comment.Via Old WorldApr 15 2011, 1:59 PM

Updated data.blend for py api changes...

current_frame --> frame_current
object.selected ---> object.select

Check for __default__cam__ name and ignore in recorder script (threw errors if nothing was selected)

Also if the user added a projectile it would never collide with teh broken objects as it was looking for game property "age" when the pieces have game property "shard"... Fixed, checked and it works.

mont29 (Bastien Montagne) added a comment.Via Old WorldApr 15 2011, 2:21 PM

Bug fixes:
*bpy.ops.object.duplicate(linked=False, mode=1) → bpy.ops.object.duplicate(linked=False, mode='DUMMY')
*Only 20 layers in Blender! (rem lines 72-74)

Enhancements:
*Commented out non-manifold check on returned shards (lines 234-235)
*Modified Fracture Group UI (now using custom draw func, to be able to search existing groups without having to reload the whole Python!)

Also, updated API version to 36147.

mont29 (Bastien Montagne) added a comment.Via Old WorldApr 17 2011, 5:34 PM

As I was at it, I made a few enhancements (I hope!) to that nice tool… So here is a 2.1 proposition :)

Heavily reviewed fracture group behavior:
* It now does a (very basic) optimization by roughly detecting if a cutter could affect
a given object.
* Now, it really fractures objects: you get “difference shards”, ie parts of object outside
of any cutter, and “intersect shards”, ie parts of object inside cutters – taking into
account situations where cutters intersect each others ! So this allows to create very precise and specific cuts.
* And optionally, you can choose whether to get only diff or inter shards.

Also changed UI part:
* Now using a single operator for both simple and group fracture.
* Put settings properties in a collection in scene object.
* This allows for the tool to be fired from a “tool panel”, like e.g. cloud generator, and
to get rid of this ugly exe property!

All this in attached file!

mont29 (Bastien Montagne) added a comment.Via Old WorldApr 19 2011, 4:35 PM

An update (correcting a bug in bbox intersection detection, and a few UI improvements).

michaelw (michael williamson) added a comment.Via Old WorldApr 20 2011, 12:23 AM

Bastien, i think your last commits broke something...

[code]
Boolean code using new merge technique.
Traceback (most recent call last):
File "/home/michael/svn-blender/install/linux2/2.57/scripts/addons/object_fracture/fracture_ops.py", line 398, in execute
self.roughness)
File "/home/michael/svn-blender/install/linux2/2.57/scripts/addons/object_fracture/fracture_ops.py", line 309, in fracture_basic
newshards = splitobject(context, ob, crack_type, roughness)
File "/home/michael/svn-blender/install/linux2/2.57/scripts/addons/object_fracture/fracture_ops.py", line 272, in splitobject
fault, newshards = boolop(ob, cutter, op)
File "/home/michael/svn-blender/install/linux2/2.57/scripts/addons/object_fracture/fracture_ops.py", line 217, in boolop
bpy.ops.object.duplicate(linked=False, mode=1)
File "/home/michael/svn-blender/install/linux2/2.57/scripts/modules/bpy/ops.py", line 179, in __call__
ret = op_call(self.idname_py(), None, kw)
TypeError: Converting py args to operator properties: OBJECT_OT_duplicate.mode expected a string enum or a set of strings in ('INIT', 'DUMMY', 'TRANSLATION', 'ROTATION', 'RESIZE', 'TOSPHERE', 'SHEAR', 'WARP', 'SHRINKFATTEN', 'TILT', 'TRACKBALL', 'PUSHPULL', 'CREASE', 'MIRROR', 'BONE_SIZE', 'BONE_ENVELOPE', 'CURVE_SHRINKFATTEN', 'BONE_ROLL', 'TIME_TRANSLATE', 'TIME_SLIDE', 'TIME_SCALE', 'TIME_EXTEND', 'BAKE_TIME', 'BEVEL', 'BWEIGHT', 'ALIGN', 'EDGESLIDE', 'SEQSLIDE'), not int

location:<unknown location>:-1

location:<unknown location>:-1

[/code]

mont29 (Bastien Montagne) added a comment.Via Old WorldApr 20 2011, 8:14 AM

Michael, I don’t know whether you talk about my last svn commit, or my 2.1 proposition (which I didn’t commit in svn), but you are using neither of those… The line in your trace back…

File "/home/michael/svn-blender/install/linux2/2.57/scripts/addons/object_fracture/fracture_ops.py", line 217, in boolop bpy.ops.object.duplicate(linked=False, mode=1)

…was one of the fixes I have to make, as the object.duplicate() op now needs a string as mode parameter (I used the 'DUMMY' one).

So please check that you really have the latest svn version of fracture, and test again…

murphy (Geoff Murphy) added a comment.Via Old WorldApr 29 2011, 2:23 AM

Ah, i don't know if i'm just missing some obscure setting, but this Add-on doesn't seem to be working on 3 out of my 4 machines. On my MacPro1,1 running 10.5.6 it seems to work, but on my MacPro3,1 also running 10.5.6, HP Touchsmart running windows7 and my Asus X55 running Ubuntu 10.10 nothing seems to happen when i press the execute check box.

mont29 (Bastien Montagne) added a comment.Via Old WorldApr 29 2011, 8:11 AM

That’s weird ! Could you please post logs from the console ? And are you sure you have the same svn version of the script on all your machines (it was modified recently) ?

murphy (Geoff Murphy) added a comment.Via Old WorldApr 30 2011, 4:29 AM

As best as i can tell, they should all be running the same 2.0 version of the script that came stock with Blender2.7 on release. This is basically what all the machines are putting out except for the MacPro1,1:

bpy.ops.object.fracture_simple(exe=False, hierarchy=False, nshards=5, crack_type='FLAT', roughness=0.5)
bpy.ops.mesh.primitive_cube_add(view_align=False, enter_editmode=False, location=(0, 0, 0), rotation=(0, 0, 0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.faces_shade_smooth()
bpy.ops.uv.reset()
bpy.ops.object.editmode_toggle()
bpy.ops.object.select_all(action='TOGGLE')
bpy.ops.object.modifier_add(type='BOOLEAN')

It doesn't actually give me any python syntax errors, however the MacPro seems to run the exact same console code, except it does it 25 times (ie that's how many shards i choose) so my thinking is that there may be some run time error in the code that causes the other machines to default to 1 shard. So as far as the python API is concerned, the code is running properly, but the because i thinks you only want 1 shard when you fracture the object it outputs the whole object as a single shard.

mont29 (Bastien Montagne) added a comment.Via Old WorldApr 30 2011, 1:03 PM

Well, if there’s no Python error, it’s gonna be hard to trace it… I’ll see if I can do something, but I do not swear anything…

meta-androcto (Brendon Murphy) added a comment.Via Old WorldMay 22 2011, 1:52 AM

Hi!
Since your script is now in bf-extensions\' svn (contrib|trunk) we have deleted the current attachments to avoid that end-users could reach this page and get the wrong version of your script.
Note that your script may have api changes or small maintenence changes applied in SVN.
Please retrieve your script from SVN before updating SVN to avoid mis-versioned scripts.
Thanks!

bupla (Mathieu Quiblier) added a comment.Via Old WorldMay 23 2011, 12:51 PM

Hi, thanks for this very useful script.
I tried it since several months, sometimes it worked and sometimes doesn't but I didn't understand why.
And today I find the cause of my problem. Fracture Object only works on Layer 1. If I try to use it on the other layers, I get this error in the console:

RuntimeError: Operator bpy.ops.object.editmode_toggle.poll() failed, context is incorrect

location:<unknown location>:-1

location:<unknown location>:-1

It's just an annoying bug, not a real trouble, though.

crouch (Bart Crouch) added a comment.Via Old WorldAug 7 2011, 5:41 PM

[canned response]

Hi, can you prepare a wiki page with a bit of a manual about how to
use this?

See
http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons

Thanks!

crouch (Bart Crouch) added a comment.Via Old WorldAug 7 2011, 5:42 PM

Please try to expand the documentation a bit, including the different options and parameters.

meta-androcto (Brendon Murphy) added a comment.Via Old WorldFeb 20 2012, 3:08 PM

hi, script is broken in bmesh, svn 44275
fracture script, fracture object, crack type spherical rough crashes blender completely.

meta-androcto (Brendon Murphy) added a comment.Via Old WorldFeb 21 2012, 10:16 PM

Hi,
Due to changes to the api including the merging of bmesh, several addons are outdated.
Please, if you are the author of an addon check your script with blender revision 44256 or newer.
That is builds made After blender 2.62 official release.
I would ask that updates be made to your addon before the Blender 2.63 release.
6-8 weeks away.
This allows time for the api to become more exposed & bmesh to stablize furthur.
If you need help, drop into irc freenode #blenderpython or #blendercoders & feel welcome to ask questions.
At the time of 2.63 release, scripts that are not repaired or in active developement will have their tracker page marked "Closed"
this will not affect your links to the tracker, similar to closing scripts in 2.49b, the page will be still availible & can be re-opened.

Thanks for your understanding & patience during these Exciting Times.
Brendon.

bato (Michael Mure) added a comment.Via Old WorldDec 28 2012, 12:42 PM

Hi,
This addon seems to have a bug when dealing with UV coordinates on object that have been mirrored.
Step to reproduce:
1) make a mirrored object out of the default cube (remove the face in the symmetry plan to get a nice closed object)
2) unwrap the one real side
3) apply a texture
4) apply the mirror modifier
5) use cell fracture

The originaly real side is stil well textured, the other have its UV coordinate messed up.

bato (Michael Mure) added a comment.Via Old WorldDec 28 2012, 12:54 PM

Additional info:
http://pasteall.org/pic/show.php?id=42529
http://www.pasteall.org/pic/show.php?id=42530

Blender 2.65

brecht (Brecht Van Lommel) added a comment.Via Old WorldJul 9 2013, 5:02 PM

Bug reported about "Setup fracture shards" operator, but it's working correct as far as I can tell so closed it.
http://projects.blender.org/tracker/index.php?func=detail&aid=36071&group_id=9&atid=498

The name could perhaps be changed to indicate that this operator sets up game engine physics settings, that's not really clear.

None (Nobody) added a comment.Via Old WorldMar 27 2010, 12:53 PM

This task was automatically closed as archived as part of migration, because it was determined to be no longer active.

The authoritative list of addons is on the wiki, we no longer have a report for each addon to track bugs and updates. Bugs can be reported individually and assigned to the addon developers. See the Addons project page for more information on the workflow.

None (Nobody) closed this task as "Archived".Via Old WorldMar 27 2010, 12:53 PM

hello,

please could any one help me..

I am getting error as,
Traceback(most recent call last):

whenever I try to export my blender files in to OGRE meshes and scenes I am getting this error please any one could help me..Its very important for me

Add Comment