Page 1 of 2 12 LastLast
Results 1 to 20 of 32
  1. #1

    ShardBundle Script for fractured meshes.

    I wrote few scripts to 'tie down' shards of fractured objects together with RigidBody Joints.Till now one had to "Suspend Dynamics" to keep everything together at the cost of....dynamics.With these scripts you can have fractured meshes behaving as whole objects which can be later shattered as you wish.This is my first script a lot of scope for improvement

    I am attaching a .blend which contains scripts and a setup of fractured objects.

    How To:
    --------
    1.Fracture a mesh or add a fractured mesh.

    2.Select shards whole object wise i.e. if you have a fractured ball select all its shards and group them using (Ctrl + G) and name it conveniently.

    3.In Scripting panel add all four scripts I provided.

    4. Choose 'nameGet' script and follow instructions in following bounded box.

    Code:
    #-------------------------------------------------------------------------
    
    #Put all Fractured object group names below.
    # Example:      Allgroups=['Group1','Group2','Group3'..]
    Allgroups=['Ball','Cylinder']  
    # No. of joints each shard will make with other shards.Should be less
    # than total no. of shards in an object group.Same order as above. 
    JtCount=[15,10]      # Higher = slower
    # Seed can be any integer.Input " 'None' " for different sim on each run.
    Seed = 123
    
    PhysicsTicRate = 200      # 60 for default.Higher = Better + Slower
    LogicTicRate   = 60       # 60 for default
    
    #-------------------------------------------------------------------------
    Allgroups : Add group names as shown.

    JtCount : Add no. of joints you want each shard to make(must be less than total no. of shards within object group)

    PhysicsTicRate : Physics calculations frequency (60 default) Higher means rigidjoints act better resulting in less shake and it is slower.

    LogicTicRate : Logic sensor tic rate .

    Seed : Insert any integer value .Insert 'None' for unique simulation on every run.

    5. Run 'nameGet' (Alt+P) after you are done with inputs.Every time you change some input value you have to Run it again.

    6.Make 'Jointer' run at start of BGE(Use gamelogic delay sensor.In example blend 'jointer' is attached to floor plane) . Press P in '3d view' to run BGE . All shards should stay together.

    7. To shatter/release shards on collision.You have to use 'Remove' script in Gamelogic.
    You basically select a shard add collision sensor(Use material/property as trigger) and Python controller(add 'remove' script in option space).And then selact all object shards
    and 'Copy logic bricks to selected' .

    8.Run BGE again 'tied' up object should fall and on contact with other object with set material/property trigger it should 'Release' shards independently.

    What these scripts do?
    -----------------------------
    nameGet : It collects name data of all shards and sets them up as Rigidbodies with convex hull and zero collision margin.And acts as interface for inputs.

    Jointer : This script creates RB Joints randomly between shards within a group.

    Remove : This script removes RB Joints of 'Owner' shard.

    Attic.py : Static data storage.

    Obvious Limitations:
    ------------------------------------
    1. Shards are released based on contact with trigger material/property not on force of impact..i will add that if i figured out how to (HALP! with setContactBreakingTreshold() )

    2. If you have lets say a fractured Pillar object and all the shards in the middle part are
    removed then top part WILL most likely float in air because shards are connected to other shards randomly(not to neighboring shards) with in object.

    A work around to above is to make section wise Groups within whole object. I will try and make another script which makes contact with neighboring objects but it might not work that well.

    3. If a fractured mesh is unstable from beginning i.e shards explode or move away from each other by themselves EVEN with zero collision margin.Then it can not be helped.
    This post will be edited in future to add stuff correct stuff...

    Q: I want voronoi fractured goodness too how?
    A: In absence of any proper tool for blender one can use 'Wings3D Manifold Lab' which is FREE and awesome!
    .exe download link http://s331378245.onlinehome.us/manifoldlab_releases/
    Also you may use these scripts http://blenderartists.org/forum/show...ull%29-Updated


    Short tutorial.
    Attached Files Attached Files
    Last edited by Brenel; 01-Mar-12 at 02:39. Reason: added info on voronoi shatter method



  2. #2
    Member vklidu's Avatar
    Join Date
    Aug 2006
    Location
    czech republic
    Posts
    829
    hm, no reactions here
    Maybe those who are interested in damaging things are waiting for Kia Kostak Demolition script, hard to say, but your way looks quite artistic friendly for failing object (didn't try shoots or exploding (by inserted object inside?)

    So, thanks for the script, finally someone brought shards back in life.
    Pilda's scripts are not updated (I mean the logic brick addon), so it's nice to see your work. In this time easier to use.

    Material as reactor sounds like great feature with many possibilities (also limitations)

    It gives me quite good result, for first release it looks great.
    You could post also your other movie:


    Here is my quick test.


    Here I accidentally grouped Monkey with Ball that created somethink like fight
    http://blender.howto.cz/blender-link...ndle-Fight.avi

    I want to test more . . .
    Last edited by vklidu; 20-Dec-11 at 10:13.



  3. #3
    Hi vklidu
    I am glad it worked for you. With no reactions i thought no one wanted it or just can not used it.To throw a Bundled up object i simple added 'Motion' from Gamelogic to shard and then copied logic bricks to all,there is no object inside hitting ball.To explode objects i am thinking of using 'appliedimpulse' command...but thing is soon this ShardBundle thing will go obsolete as you may know Phymec is working on his own tools and i am hoping he will release it soon.If you need any help ask here! i tried my best to describe to use this script in words may be I should make video tut but my voice is not good :P

    Edit holy cow i was playing with getimpulse() and it is exactly the thing i need! i think i replace material trigger with this to make impact trigger



  4. #4
    I like the example video's and i would like to make something like this. but i can't get it to work. i downloaded the sample and it just falls apart. or shouldn't i use blender 2.61?



  5. #5
    Hi! Thanks a lot for your amazing work here!!! COOL!

    Would you help me?

    I played around a littlie bit, and find out that the remove-script in gamelogics does not do what i whant.

    Whe i follow your instructions everything works well.
    Now i tryd to use a different material on an cube. When a shard collidate with this cube (material) the fracturment should start.
    BUT- it starts everywhere ... also i tryed a delay-sensor and anything to control the startpoint of fracturing :/



  6. #6
    Found it!
    Its your step6: Using the Joint-Script on GE-Start ... We cant use this on a shard (please write this to your instrucions).
    Just use the mainplane (floor iE) foth the Joiner-Script.

    Then we can use iE a mouse click to start fracturing ...
    Ill make some vidoes!

    GREAT WORK MAN! THANK YOU!!!



  7. #7
    Member bashi's Avatar
    Join Date
    Oct 2010
    Location
    Bern, Switzerland
    Posts
    916
    this looks interesting. I've made some Shatter Script test myself, i've let it break/delete the constraint based on velocity of object (Shards or Obstacle).

    i will look into your script. bashi



  8. #8
    Member mrjynx's Avatar
    Join Date
    Apr 2008
    Location
    England
    Posts
    749
    looks amazing, don't be disheartened by lack of replies. a lot of people really appreciate what you're doing for blender.
    A guy who thinks of himself as intelligent for using needlessly complex and time-consuming methods of accomplishing simple tasks is truly the worst kind of idiot.



  9. #9



  10. #10
    Originally Posted by ankz View Post
    I like the example video's and i would like to make something like this. but i can't get it to work. i downloaded the sample and it just falls apart. or shouldn't i use blender 2.61?
    Follow step 5 .Just run 'nameget' and then run bge by pressing 'p'.

    @dafassi: Info added on step 6.Thanks for feedback.



  11. #11
    Member Jonathan L's Avatar
    Join Date
    Aug 2011
    Location
    Seattle, Washington
    Posts
    1,659
    Does this make it so that a smooth shaded object is shaded right until it is shattered, or does this only work with flat shaded objects? It looks great so far!



  12. #12
    Originally Posted by Jonathan L View Post
    Does this make it so that a smooth shaded object is shaded right until it is shattered, or does this only work with flat shaded objects? It looks great so far!
    Flat shading only as object is prefractured.If you smooth shade it ,cracks will show.This script has nothing to do with shading aspect of object.



  13. #13
    First things first:
    Thank you so much for this script! Really made things a lot easier and more realistic.
    But... I just can't get a good result from Wings3D Manifold Lab. And I can't find a tutorial.



  14. #14
    Originally Posted by Frodo91 View Post
    First things first:
    Thank you so much for this script! Really made things a lot easier and more realistic.
    But... I just can't get a good result from Wings3D Manifold Lab. And I can't find a tutorial.
    How results are not good from manifold lab? Are there pieces missing? Are faces flipped ?

    short tut:
    1. Get mesh you want fractured.
    2. Select it and right click > in menu click 'lots more' > Click voronoi tidbids via tetgen (low value for more pieces)
    3. scale main mesh down so its not visible and totally hidden in pieces.
    4. zoom in a bit and you will see main mesh selected with red highlight.Right click > lots more > click .Polyhedra as cutter.
    5 You should have trimmed pieces with zero missing pieces .Export them as you wish.You may need to split loose parts in edit mode in blender.



  15. #15
    Thank you (again)!
    Now everything works just fine.



  16. #16
    Ive tryed a few things and got all the time the same problem...
    How can i control how much pieces break out?
    Sometimes there are just a few and the rest glues ... but why?

    What would be great:
    Show me a way to group some shards of a mesh.
    So i have iE 3 different shard-groups on ONE cube that i can break as i whant .

    Videos will come ...just wait a few days .

    Thank you for the script ... ill use it in Reel-Footage-VFX-Experiments!
    But please improve it!
    As an becoming VFX-Freelance i need such good tools.
    IŽd pay for it, if it would be more controlable!

    HAPPY NEW YEAR 2012!

    Dennis



  17. #17
    Blender Fracture Tools:

    Voronio Fracture:



  18. #18
    Originally Posted by dafassi View Post
    What would be great:
    Show me a way to group some shards of a mesh.
    So i have iE 3 different shard-groups on ONE cube that i can break as i whant .
    Just select the shards you want to break out and add them to one group. Then select the next group of shards and add them to another group and so on... Then write them into the script and in the GameLogic put a delay sensor instead of an collision sensor. Maybe there is a better way, just play with the GameLogic sensors.



  19. #19
    Originally Posted by dafassi View Post
    What would be great:
    Show me a way to group some shards of a mesh.
    So i have iE 3 different shard-groups on ONE cube that i can break as i whant .
    Ok if i understand, you want to 'break' some shards in different manner(whatever way you want) than other shards in same group ?
    For this you must understand role of 'Remove' script.This script simply removes all rigid joints the particular shard it is attached to has with other shards so it is set loose.If you you don't attach this script to shards? they wont 'break'. It entirely up to you how you want to trigger this script,in example i provided materials are used as trigger along with collision sensor.

    I was trying to make impact based trigger but there is a fundamental problem,since each shard has more than one joint with other shards what happens is some joints 'break' when they cross certain impulse limit and others don't so object may still remain intact after good collision it would just become a bit shaky as some joints within it are removed .So i guess material based trigger is best.


    @Frodo Great Videos ! Finally some one is getting good results thanks for posting :-)



  20. #20
    Thank you both for your answers!

    No i have a basic-problem with marking the shards of one mesh.
    When i use a rectangle-mark-tool allways some shards of other groups are marked.
    I need a precision way.
    Maybe my blender-know-how is not good enaugh.

    In example:
    1 Ball with 3 groups.
    3 Steps and a floor.

    The Ball hits the upper step: nothing happens
    It jumps down to the middle step: Group 1 breaks
    It jumps down to the bottom step: group 2 breaks
    It jumps down to the floor: group 3 breaks

    I just need to know how to make the groups- or how to MARK the shards to group them.
    Also i dont know how i can give groups different colors and make the visible .

    Thank you!



Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •