Halloween Costume ideas 2015
Articles by "maya"
@dorothiar #arttips #interview 101 2 Column Template 2012 mentee 2013 2013 mentee 2014 2014 mentee 2014 Portfolio Winner 2014 SCBWI Portfolio Mentorship Winner 2015 mentee 3 Column Template 360 3d 3d print 3d printing 3delight 8bit Abbey McCulloch abstract acryla gouache acrylic action addon adobe Adobe Flash CS3 Adobe Illustrator Advanced Tutorials advection Advertising advice Agata Wierzbicka agents airplane Al Wiseman ALA Alan E. Cober Alan Lee Alex Ross Alexandra Compain-Tissier Alexandra Lekias Alexandra Levasseur Alexandre Korobov Alexis Winter algorithm alien ALT Amelie Hegardt Amit Shimoni amusement an Ana Aranda analog Andrea Hrjnak Andrea Hrnjak andrea offermann andreaoffermann andreazuill Andy Musser Angela DiTerlizzi Angelika Peißker animal logic animals animation animation nodes anime anisculpt Anja Kroencke Anna Higgie Anna Jensen Anna McKay Annabel Briens AnneBerry Anneke Krull Annu Kilpeläinen anstudy anthology António Soares ar arduino area armature arrange array array modifier arrow art art director art directors Art is fun! art reps art tools Artaksiniya arthictecture arthur rackham artists artwork ase Ashlyn Anstee Asian aspiring asset atom attribute attribute transfer audio Audrey Kawasaki augmented reality aurasma Aurelius Battaglia author illustrator automatic automation Autumn Whitehurst avatar Avrom Yanovsky AW14/15 award awards Babeth Lafon Babies baboon Baby Love Background background color bacteria bake baking ball Bamboo banner Banner images banner making Barbara Dziadosz barcode basic bbox beads beats Bec Winnel beginner Bel Johnstone Ben Denison Bernie Fuchs Berto Martinez Beth Krush better photos bge Bijou Karman Bike biscuit bishop black and white black and white art Blair Breitenstein blam blender blender game engine blender3d blending Blinkie Blinky blob blocks Blog Tips blogger Blogging Friends blogs Blonde blur effect in pixlr and photoshop blur images and pictures bmesh bmesh viewer bolognaragazziaward bombing bone bone modeling bones book book launch books boomerang bottle bounding box bowl bpy brian eno brian ormiston Brian Sanders brian won brick bridge Bridget Davies bright Brooke Boynton Hughes build modifier building burns business Buttons bvh cage Caitlin Shearer caldecott calibration camera camera settings camera tips Candle capcom card career Carole Wilmet cartoony Cassandra Rhodin cast Catherine Campbell Cecilia Carlstedt cell center pivot centipede cg cg photography chair challenge Chanel changin color in pixlr changing color chaos character Character Bible character development charcoal charles Charlie Dot Charlie Hebdo Children children's book illustration chocolate Christina Drejenstam christina forshay Christina K christinaforshay Christmas Cindy Derby circle circle dance city cityengine clock clones cloning cloth Cloud based clover CMYK Coco Chanel Cody and the Fountain of Happiness coffee collect collection Collections collision color color balance color cast color correction color mode color study colorful Commercial Use complexity component compositing composition computational thinking computer concept art Condensed Posts conference connect connect the dot connection Connie Lim Conrad Roset constrain constrast contagion content Contest contracts control converter copy copyright Corinna Luyken count Courtney Brims crack Craft craftsmanship Craig & Karl creative creativity creature cricket Cristina Garcia Martin critic criticism critique Crop Crop Tool cross section crowd csv cubism curve curve modifier custom Custom Blog Design Custom Blog Design Tutorial Custom Blog Designers Custom Illustration custom properties Custom Signature custom xml cut cutting plane cycle cycles dae Damien Florébert Cuypers Dan Hillier dance Daniel Egnéus Daniel Segrove Danny Roberts Daren Newman Dasha Tolstikova data data path David Blossom david diaz David Shrigley David Stone Martin Dean Hardscrabble Debbie debbie ohi debbieohi deform deformer degrees deleting background in pixler demo demoscene desaturation of images design design by numbers design process Design Tips dictionaries dictionary Different Text Writing in Pixlr digital digital paint Digital Scrapbook Freebies Digital Scrapbooking disk distance distractions distribute diversion DIY DIY Contest Dolf Veenvliet Doll Doll Bones dolls domino domino effect doodle Doodles door doraemon Doris Jackson Dorothia Rohner dots dpi draw drawing drill driven driver drivers dual versions dummy duplicate duplicates duplication dupliframe dvd dynamic dynamic paint dynamic text E Simms Campbell Easy easy pixlr Easy Tutorials Ed Graham Ed Vebell editing editing photos editors education effect effects ego Eleanor Dalton electric Elia Fernández eliza wheeler Elizabeth Mayville elizawheeler Emily Forgot Emma Zanelli emoticon happy-face Emotional storytelling empathetic characters empty entoforms envy epicycloid EPS Illustration Epson scanner erasers Erin Armstrong Erin Petson erinoshea ernest shepard Esra Roise euler evaluate line Eveline Tarunadjaja evenly spacing vertex event everywhere door exhibition Expandable Posts experiments explode exploded view export expression extrude eye eye color in pixlr eye trick eyeball face rig facial expressions facial setup factory Faiyaz Jafri Families fashion illustration fashion week fcurve feature Featured Fee Harding Feedback fence Fernanda Guedes fibonacci Fifi Lapin file File Types Finalists Finding Nemo fire fix photos Flash Tutorials flicker flip flip flop floor flop flow flower Flowers fnmatch focal point follow up font Fontaine Anderson Fonts food footage For Sale force form formula fractal fracture frame Frames Francois Berthoud Frank Bellamy Frank Furlong Franklin McMahon freckles Fred Steffen FrederiqueBertrand Free for Commercial Use Free for Personal Use Free Stock Photography Free transform tool Freebies Frenchillustration Fritz Siebel frosted mylar fruit ninja Fumi Mini Nakamura Fun function futurism FW2017 fx Gabriel Moreno Gabriella Ibarra game game animation gameart gamma gangnam style Garance Doré Gary Fernandéz gel medium generate generative generator geometric geometry Gerald Lazare Géraldine Georges GIF Gildo Medina Girl Giuseppe Castellano Giveaway glorar goals golden ratio google google docs Google Tools Grant Young graph graphite graphite transfer grease pencil grid group group node growth Gucci Guest Guil Godier gustave dore hair handbook Harper's Bazaar harpercollins Harvey Schmidt Haute Couture head Headers heat map Helena Hauss hexagon hexagonal grid Hiroshi Mizuno Hiroshi Tanabe Holiday Holly Black homology honeycomb hook horror houdini how to how to blur a face or an object in pixlr How to change eye color how to delete an object how to desaturate an image how to edit a image in pixlr how to erase an object how to fix red eye problem how to fix red eyes in pixlt How to fix the parts in pixlr in photoshop How to make a banner in pixlr How to overlap the nevus how to remove a object How to remove an object in pixlr how to remove red eyes How to Remove the Background of an Image in Pixlr How to remove the parts that you don't want in pixlr and photoshop how to replace color How to write a Patterned Text in Pixlr how-to Hsiao-Ron Cheng hsv hue humor Hyshil I love illustration magazine idea ideas Igor+André illusion illustrating illustration illustration board Illustration Books Illustration Intensive Illustration Now! Fashion illustration process Illustrations Illustrative Berlin illustrator Illustrator Intensive Illustrator Tutorials iloveillustration magazine image ediditing lessons Image Ready image sequences image theft imaginative import import text import vertex color improving photos inbetween index visualizer Info Ingrid Bockting ink inktober input Inspiration inspirational quotes install instance instance switching intensive interaction Intermediate Tutorials internet interoperability interpolation intersect intersect edges intersecting intersection interview introduction invoke subprogram io ipad Irana Doucer Isabella Hemmersbach islam islamic iteration Izzie Klingels Jack Hearne Jack Tremblay James Dignan James Gurney japanese Jason Brooks Jean Kim Jeanne Detallante Jen and Chris Creed Photography jen betton Jen Rofé Jenny Mörtsell Jeremy Combot Jeslyn Kate Jesse Auersalo Jessica Jessica Lanan jessicalanan jewellery jewelry jiggle Jim Schaeffing Joe Bowler Joe Cleary Joe Isom Joe Krush Johanna Goodman john maeda John Vernon Lord joint Jordan Sondler JPEG JPG jpop juana martinez-neal juanamartinezneal Judge Judit Garcia Talavera Judith van den Hoek Judy Byron Schachner Jules Julien Julian Beever Julie Verhoeven Jump Break Tool JW Anderson K-Fai Steele Kaethe Butcher Kareem Iliya karel zeman Kate van Harreveld Kathrin Kuhn Kathryn Ault Noble Kathryn Noble Katie Kath kdtree Kei Meguro Kelly Beeman Kelly Light Kelly Smith kelly sonnack Kelly Thompson keyframe keyframing kidlit kidlitartists kimberlygee Kirkus Review Kisoo Chai Kodak Konstantin Kakanias Korean illustration Kotaro Chiba Kozue Himi Kremos Ksenia Finogeeva KT Smail kuler Kustaa Saksi Lanan Laptop larry gritz lasso tool latte lattice Laura Callaghan Laura Laine Lauren Rille layer layering Layla Holzer layout leaf learning learning blender LED Leendert meets Ingrid lego length Leonard Starr lessons levels LFW A/W 14 liangzhu liero lightbox lighting lightning Lina Bodén Lina Ekstrand Linda Dorn line line connect line drawing lines Links Linky Love Linn Olofsdotter Lionel Gilbert Lisa Anchin Lisa Billvik Lisa Krannichfeld lisaanchin lisbeth zwerger Liselotte Watkins list list comprehension List First Last listing locator lofting logo Logo Design Lola Dupré London Fashion Week loop looping loops looptools Lorraine Fox lossless lossy lost weekend lostweekend lotte reininger Louis Glanzman louis vuitton Luciana Rondolini luciograph LULU* lv Lynnie Zulu Mac macgyver macouno maeda Magda Antoniuk magic Magnus Voll Mathiassen mailing mailings maker Makiko Sugawa making banners Malika Favre MAMP mandala manga map map range maplelam mapping Marcel George Maren Esdar Margot Macé Margot van Huijkelom Maribeth Olson Marie El-Ahmar Marilyn Conover Marina Esmeraldo Marine Marbleindex mario Marlies Niemeijer Marsha Riti Martha Rago Martin Krusche Martine Johanna mask masking material materials math matrix matrix apply matryoshka Matt Baker matte medium Matthew Woodson maya maze mdd Meagan Morrison measure megaman Megan Hess Meizhen Xu Mel Crawford memory mentee mentees mentors mentorship program Mercer Mayer Meridth McKean Gimbel mesh mesh cutter meshlab Meta Tags metal gear rising Meyoko Mia Overgaard Micca mice Michael Sanderson Michela Picchi middle grade midi miku Milan milipede minidom Minima Mio Matsumoto mirror cut Misc Miss Blackbirdy miss maple's seeds Miss Take Mitchell Hooks mixamo mixing Mobile Apps mocap mod model modeling modifier modular modulation modulus mold molecule molly idle Molly Ruttan Molly Ruttan Illustration money monitors monkey mono-zero monster monster university morph morpher mosaic mosquito motion motion capture motion capture mouse motion trail moto360 mountain muji Muriel Wood Murray Tinkelman mushroom Music and Podcasts My dead pony Nadia Flower Naiad Einsel Naja Conrad-Hansen Natalie Brockett Natalie Foss nathan vegdahl nautilus Nav Bar navigation needle-felting negotiating Neil Boyle neon nescbwi14 nested New Blogger Questions New Blogger Template Tutorials new user pixlr new year new york New York Fashion week Newbery nicholas nicholas bishop Nicholas Hong Niki Pilkington Niso Ramponi nla No Software node node-based nodebox noise non linear animation Non-Web Font normal Noumeda Carbone npr number NURBS NYFW object object color change object info octopus offset Ola Volo Olaf Hayek old formats opaque projector open movie open shading language open source openshadinglanguage opensoundcontrol optical organization origami original art show Ornaments osc Oscar Schlienger osipa osl outline outliner output Pages paint paint weight painting painting on illustration board painting on wood painting with movie painting with numbers Pair pandas panorama Paper paper lantern parabola parametric parent parenting particle particle info node particles pat david Pat Zietlow Miller pattern Patterned Text Paul Faassen Paul X. Johnson Paula Sanz Caballero PC pdb pebbles pencil Pencil Sketch pencils Penguin perfume perlin Peter Helck Photo CD.8B photo editing software Photo Reference Photobucket photographing art Photographs photography photomerge photoshop Photoshop Brushes Photoshop CS3 Photoshop elements photoshop pixlr desaturaion Photoshop tips Photoshop Tutorials Picture Book Builders picture books Pierre Louis Mascia Piet Paris Pietari Posti pingpong pinnochio pipes pixar pixel pixel art pixel generator pixlr Pixlr advanced Pixlr blog pixlr desaturate keep a colorful part pixlr editting pixlr express Pixlr forum Pixlr free transform Pixlr Lesson Pixlr lessons Pixlr mobile Pixlr resizing images pixlr shortcuts Pixlr tools pixlr tutorial pixlr tutorial with pictures Pixlr Tutorials pixlr white black pixlr.com plant plot plotting ply PNG PNG Illustration podcast point point color pointilism polka dots polyCut polygon Pomme Chan pop-overs portfolio Portfolio award portfolio showcase portfolio-advice portrait position Post Dividers postcard poster Posting pot powdered graphite powerhousemuseum Prada presentation print printmaking Prize procedular procedural process processing programming projection Promotion property prototype PSD psy publishing pulse puppet puppetry pydriver pydrivers pyhandler pyhandlers pyramide python quad quick select set quick tips qumarion Rabbit Moon Rachel Ryle radians radius ramp random random motion randomization randomize range float raspi Ray Houlihan reading reading XML READY-TO-WEAR realflow Rebecca Clarke rebecca dautremer Rebecka Skog rebuild recursive recursivedrawing red eye remove reducing glare reference referencing release remesh modifier remix removal remove remove red eyes remove unwanted objects Removing backgroung render rendering renderman repeat repeater repeating replace replacement replacing color representation rerouter resample resampling research Resizing image resolutions retopology retro review revolve rgb rib Ricardo Fumanal Richard Scarry rig rigging rigify Rikke Jorgensen ring ripple roadkill Robert Heindel Robert J. Lee Robert McCloskey Robert Shore Roberta Zeta Robin Rosenthal robot robotic rocks Rodolfo Montalvo Roller Coaster rotation Rousseau rsl Rubin Pfeffer ruler tool Russ Mills russian rut S/S14 S/S15 S/S16 Sabine Pieper sadako Saftey Pins Sainte Maria Sale Sam Weber Sanda Suy Sandy Kossin santoso Sara Andreasson Sara Singh Sarah Jacoby saturation artist tools scan scanners scanning scatter scbwi SCBWI 2015 mentee SCBWI conference scbwi germany SCBWI mentorship scbwi-la scratch scratchboards screensaver screw screw modifier script scrub sculpting seamless Seamless Patterns Search Engines select by material select by name select by type SEO sequence series set keyframe set keyframes shader shading shadow Shannon Stirnweis shape grammars shape key shapekeys shapes shards shatter Sheilah Beckett shell ship shipping shipwright Shoes SHOWstudio shuffle Sid Barron Sidebar Titles Signature Silja Goetz silkworm Simon and Schuster Simon Varela simple simplicity simulation sine Site Engine Optimization Sjoukje Bierma sketch Sketches sketching skin skin modifier skinning slice slicing slides sloth slow parent smoke smoothstep SN snake Sneek Peek snippet Snow Snow White Snowflakes soccerball social media Social Media Buttons Social Networking society of illustrators Society6 soft body softbody Sonia Menti sound sound wave space spaceship sparta special spider spiderman spiderweb spin spiral Spiros Halaris Spiros Halaris x Urban Decay spline Spot Healing Tool spreadsheet SS16 stack stacking stair stamp Stan Galli star starfish stencyl step Steven G. Dobson still Stina Persson stone stones storytelling strand strand info strands street art string stripes structure studies studio style stylistic summary Summary Posts Summer sun supplies surface Susan Farrington suzanne Suzanne Kaufman sverchok swatch switch sydney system table table of contents take out background Tal Drori tangent tangled Taschen teaching teapot Template Templates tentacle Tess Jacobson Tex Avery text text editor Text Formats Text Styles in Pixlr texture texturing The Cartorialist The Grudge Keeper The Purple Book thinker1 Thomas B. Sawyer thread TIFF tile tilecam tiling time time code Tina Berning Tina Kugler tips tips for artists Toby Neilan Tom Baxter Tom Bjarnason tombow tomie depaola tool tools topology tower Tracy Turnbull Train transfer drawing transferring sketch transform transformation transit travel triangle wave Tricia Springstubb trigger tris tristan lock tube tubes Tutorials twitter type tool typeface typography unbake unity3d universal unquad utah uv valentine Valentino Valerie Servais vanilla variable variation variety vase vector vectorized Velwyn Yossy venus Veronica Ballart Lilja vertex vertex color vertex group vertex paint vertex weight VFX Victoria Boysen video Videos viewer Vintage virtual virtual studio visualization vivid vividfestival VOGUE volumetric voronoi Vote voxel voxelated voxelation walking teapot Walter Einsel wand tool water soluble graphite watercolor wav wave we need diverse books web webbing Week Themes weight welcome Wendy magazine Wendy Plovmand what casues red eyes What is Pixlr Wherever You Go Wide Awake Bear wiggle Will Davies Winner Winnie Fitch Winnie Truong Winter wire wired wireframe wolfram Woman wood woodwork wool wooly wordpress work workflow World writing writing XML www.pixlr.com XML YA yayoi kusama Yelena Bryksenkova yoda Yoko Furusho Yuliya zaha hadid zen zsphere

Dynamic Human Array using Dynamic Paint. Rendered using Blender Freestyle.

VIDEO DEMO




THE PROCESS

0. Prepare 3D Model from Make Human

1. Rig and Control using Mixamo Auto-Rig in Maya



Since I just need a quick dummy rig, I quickly use Mixamo free auto rig (for under 10000 tris model) and download it into Maya. Thanks to Mixamo.

2. Pose and Animation in Maya


I have to rely on Maya with rigging and animation. I have been using Maya for rigging and animation in the past 10 years, so please pardon me.

Eventually I will produce everything using Blender. I can see that Blender has nice auto-rig and plenty of rigging tool, but it takes time.

3. Export animation into Blender using MDD Mesh Cache.


MDD Mesh Cache Modifier is super handy. Animation Cache import from Maya is a breeze.

4. Setup Dynamic Paint Array using Python in Blender


Let Python do the job of connecting Drivers.

5. Animate Human Array in Blender


I realized that with this setup, we are really using a lot of RAM and processing power. Blender handles it quite well and the effect is still interactive.

I need to think of optimization. Obviously few millions of moving vertex with 6 GB will be a bit slower. Need more RAM.

6. Render using Blender Cycles.


The render is fast. Cycles is amazing.


Have you ever wished that you can Cut and Slice a 3D object using Cutting Plane of some sort in Blender? Let's explore on how this can be done in Blender.

MAYA POLY CUT FACES TOOL
From someone coming from Maya background, I have another wish that Blender has Maya feature to do Poly Cut Faces Tool (polyCut node). Basically a function to be able to slice and cut any mesh using Cutting Plane. I am sure this can be done in Blender.

Maya Poly Cut Tool slices like Fruit Ninja.
To further describe this "cutting" function, we can observe slicing games such as:

BLENDER KNIFE TOOL
In case you don't know, there is actually a Knife Tool (K) in Blender that allows user to Cut Slice 3D mesh in Edit Mode. Blender Knife Tool is one of the best out there. It slices through everything (front and back faces), if you hold Z while using the Knife Tool.

Blender Knife Tool, in Edit Mode.

BLENDER DUAL-SIDED BOOLEAN (AKA BLENDER POLY CUT TOOL)

Now, I will propose a strange method that you can use to simulate Maya's Poly Cut Tool in Blender to slice and cut through 3D mesh.

What is the trick? The almighty Blender Boolean.

How does it work? Let's take a look by an example.

1. Start with the default Cube and a Poly Plane.

Make sure that our "cutting plane", the Poly Plane geometry really cutting through and covering the area you want to slice.

2. Apply Boolean
Next, we just apply Boolean Modifier (Difference) to minus the Poly Cube - with Poly Plane:



We get 1/2 cut of the Poly Cube. You see how interesting that Blender understands and respects the Plane Face normal and giving the result like above:

Poly Plane Face Normal and Boolean Result respecting the normal.

3. Duplicate the PolyCube + PolyPlane + Boolean and Flip the "Cutting Plane"
Now, we will do a simple hack here, we will duplicate the Poly Cube + Poly Plane with Boolean Difference (while the modifier is still live).

The result will be the exact same thing. Unless, we actually reverse and flip the normal of "cutting plane". And so we get something like below:


If the Boolean Modifier is applied to both 1/2 slice of the cube, we will get exactly what we want, I will give color to both slices so you can see exactly what just happened:

This is exactly what we want! Super easy, right?

THE LIMITATION:
The limit of this method is solely depending on Boolean result. If the object to be cut and slice is made of multiple objects, then the cutting and slicing won't work. Better off slicing and cutting on just a single mesh and then re-join them again later.

ALTERNATIVE WAY OF CUTTING, GREAT FOR MULTIPLE CUTS

We can actually use a Plane with very tiny amount of thickness that will result it both side of cuts at the same time, instead needing to duplicate.

Blender Boolean is pretty stable and powerful in this case that it will "slice" and "cut" even when the thickness of reference Boolean is very tiny (value like 0.0001).

So, for our "Cutting Plane" (Poly Plane) we simply extrude it with a super tiny value that our eyes cannot see.

Then, we use it with Boolean Modifier to cut slice our object.


As you can see it works great with multiple cuts. Below is example on how the Boolean Modifier got stacked. Don't attempt to join the Cutting Plane and do a single cut. You better off doing multiple Boolean Modifiers this way. For simple and evenly distributed Cutting, you can use Array Modifier to the "cutting plane".


Doing it manually is pretty simple, just click on Copy and replace the Slicer object. Here is the resulting cut pieces after we also click Apply on every Modifier, one by one. We will script this later, I promise.

Randomize each pieces using my previous script that gives random color on selected objects.

Especially nice if we then apply Blender Bullet Physics. This is obviously less cool than Blender Cell Fracture (Voronoi shatter), but still useful in some case, especially if like to specifically Cut and Slice objects.



LIMITATION:
When the object is too complex, it is possible that the Boolean failed. Fox example, if mesh to be cut and slice has holes like Suzanne eyes, or made of multiple pieces.


However, regardless of limitation, the use of Solidify Modifier and Array Modifier for Poly Plane (Cutting Plane) and Boolean Modifier for the object to be sliced is actually quite robust and procedural. The effect is live and you can cut and slice and adjust it and see the result right away, what else can we ask?



AUTOMATING THE PROCESS USING PYTHON

Below scripts will automate the process of Cutting and Slicing for you.


BLENDER SUSHI SCRIPT: Convert selected Planes into Boolean Cutting Planes


"""
Auto apply Boolean Modifier for cutting and slicing.

Copyright (c) 2013 Jimmy Gunawan at Blender Sushi Blog
Name: Name of the script
Version: 001
Author: Jimmy Gunawan
Contact: blendersushi@gmail.com
Date Created: 2013.05.02

How to use the script:
1. Prepare some Poly Planes in which you already apply "Solidify Modifier"
as your cutting planes.
2. Select all the Cutting Planes, and your Mesh (to be cut) last.
3. Run the script to connect every Cutting Planes to the objet.

"""


import bpy

# Get all selected except Active Object
slave_objects = (bpy.context.selected_objects)

# Get Active Object
master_object = bpy.context.active_object

# Iterate each newly created Modifier to point to corresponding slave objects

for num, slave in enumerate(slave_objects[:-1]):
print(slave.name)
bpy.context.scene.objects.active = master_object
bpy.ops.object.modifier_add(type='BOOLEAN')


current_modifier_name = bpy.context.object.modifiers[num].name

bpy.context.object.modifiers["{current_modifier_name}".format(current_modifier_name=current_modifier_name)].operation = 'DIFFERENCE'
bpy.context.object.modifiers["{current_modifier_name}".format(current_modifier_name=current_modifier_name)].object = bpy.data.objects["{slave_name}".format(slave_name = slave.name)]





VIDEO:


BLENDER SUSHI SCRIPT: Quick Apply Modifiers
If you then want to Apply all Modifiers, you can quickly do that by selecting the object with Modifier stacks, and then run the script below:

'''

Quick script to apply all modifiers of currently selected object(s)
'''

import bpy

def applyModifier():

# Get list of currently selected objects
selected_objects = bpy.context.selected_objects

for object in selected_objects:
    # Make object in the list as active one by one
    bpy.context.scene.objects.active = bpy.data.objects[object.name]
    
    # Get all current object modifiers
    current_object_modifiers = bpy.context.object.modifiers
    
    # Iterate every modifier of current object
    for modifier in current_object_modifiers:
        print(modifier, 'is deleted')
        bpy.ops.object.modifier_apply(apply_as='DATA', modifier="{modifier_name}".format(modifier_name=modifier.name))
        
applyModifier()



BLENDER SUSHI SCRIPT: Auto-Random Cutting and Slicing of Selected Object(s)

<< SCRIPT COMING SOON>>


WISHLIST: Actual Cut Face/Cut Plane Tool

I think, it is possible for Blender to have Cut Plane Tool that work more like Knife Tool. Maybe a more experienced Blender Developer can create such tool.

For now, this easy and fun hack will work fine for us.

ABSTRACT CUBISM ART

The reason I am writing this article on Cutting and Slicing is because one of my students Goreisha, asking me how to create Abstract Cubism Art using Adobe Illustrator. The Abstract Cubism that she wanted to create resembles slicing of planes into triangles pattern (Delaunay triangulation).

I told her it's probably easier to do using Blender in 3D.

Well, of course with Illustrator, we can use some random lines and Pathfinder tool to do something like Boolean but in 2D.  And then maybe with some scripting, Illustrator can randomize the Fill Color of each pieces. But it is a pain to do, I imagine.

Anyhow, I think it is much more flexible to do it in 3D and render it out, everyone agree? We can have all kind of beautiful renders by adjust light and materials.


Random RGB abstract cubism.

Random HSB abstract cubism.
Remember the RGB vs HSB thing that I have mentioned in the past? HSB Hue variation is more pleasing to the eyes. Of course, you can also specify a bunch of color that Blender can sample and then apply in random fashion.

This is for my student "wallpaper design", so we can be random about the slicing. In the future I will think on a way to actually create a more interesting Cubism Art based on photograph or something.

CONVEX HULL
Probably not directly related, but it is still about messing around and remeshing around with mesh and Nicholas Bishop "Convex Hull" implementation in Blender is super interesting for me.

Kind of know that Convex Hull is used in Blender Bullet Physics, but I didn't know until today that we can simply go to Edit Mode and apply Convex Hull to selected Vertices of Mesh, do you?
http://wiki.blender.org/index.php/User:Nicholasbishop/Convex_Hull

FURTHER CHALLENGE: Delaunay Triangulation?
Thinking about creation of Delaunay Triangulation Pattern on a Mesh, I actually always wanted a kind of Modifier in Blender that does pattern slicing and cutting based on Particles and scattering of Points, which should result in Delaunay Triangulation.

Maybe we can actually create something like that via Python scripting. Anyway, I will save that for future. Maybe Blender developers interested to add this feature.

Not sure 100% what I am looking for, but I just like the idea to Remesh as Delaunay.

Below some links related to Delaunay Triangulation:
http://blenderartists.org/forum/showthread.php?255237-Addon-Points-cloud-Delaunay-triangulation-amp-Voronoi-diagram
http://www.codeproject.com/Articles/492435/Delaunay-Triangulation-For-Fast-Mesh-Generation
http://blenderartists.org/forum/showthread.php?104071-Delaunay-triangulation-script
http://blenderartists.org/forum/showthread.php?65240-Triangle-Mesh-Fill-Script-for-Bezier-Curves
http://blenderartists.org/forum/showthread.php?255237-Addon-Points-cloud-Delaunay-triangulation-amp-Voronoi-diagram
http://blenderartists.org/forum/showthread.php?280085-Polygon-reduction-edge-collapsing
http://blenderartists.org/forum/showthread.php?265368-Delaunay-based-volume-rendering-in-Blender

SEE ALSO:
http://blenderartists.org/forum/showthread.php?175265-A-Blender-cutting-tool-for-meshes

Bunch of Cubes from Maya, imported into Blender (Color, Position) via XML and dynamically animated using Blender Bullet and rendered out.

PREREQUISITE

  • Python basics
  • Python data type, especially Dictionary
  • cElementTree module
  • File Read and Write
We will be looking at a bit of theory of XML and its practical usage.

PROGRAMMING AND DATA

The more one learns about programming in Python (in Blender or other 3D packages), the more one can see the pattern that the whole thing is really about "data management" and "data processing" and "data visualization":
  • How to retrieve data
  • How to process data
  • How to store data
  • How to export and import data
  • How to display or present the data
As "boring" as those may sound for artists at first, data is apparently can further be processed and presented elegantly in a creative ways. Lots of raw data just means more opportunity for us (artists) to visualize it in a beautiful kind of way.

3D artists (like you and me) are lucky from the very beginning to work visually with computer data from the very beginning (at least in the last 20+ years). All we have to deal is the Interface. Still there is a sweet and sad labor of hours in doing what you are doing :)

However, if we really want to dig deeper with Computer Graphics, it is nice to be able to read raw data and process them in a magical kind of way.

In this post, I will be attempting to do an introduction to XML, XML Writing and Reading. I am not from programming background and writing this post is quite strange to myself as well. Anyhow, I feel like writing and sharing with you all.

IT WAS CSV

I have written a bit about CSV (Comma Separated Value) data and Blender export-import using CSV a while ago. At the time I was still clueless about Python and programming. I felt that CSV is really simple and easy to understand so that was my reason to use CSV.


Sooner or later we will realize that CSV is probably limited in term of what we can "store" and "parse" from it. It does not have much of STRUCTURE apart from a long list of strings and numbers and line numbers. It can represent ROWS and COLUMN type of data, but not so much of HIERARCHY data.

See how CSV is parsed inside program like NodeBox or Houdini. It's still pretty cool:
CSV -> TABLE -> VISUALIZATION
http://blendersushi.blogspot.com.au/2012/12/python-importing-and-visualizing-data.html


\BLENDER CSV F-Curve Import 
http://blenderartists.org/forum/showthread.php?209181-A-Script-to-Import-a-CSV-File-and-Create-F-Curves-(for-Blender-2-5x-or-later)

So then, what is the alternative of CSV? Just a few days ago, I learned something new (yes, new for programming newbie like me!) called XML.

I think this XML is really worth looking.

Let see what can we do with XML using Python inside Blender.

What is XML?

XML stands for eXtensible Markup Language. Apart from this long name, I think the best description and what XML really is, can be read here:
http://www.w3schools.com/xml/xml_whatis.asp
http://www.w3schools.com/xml/xml_tree.asp#gsc.tab=0

The simple way I see XML is a kind of data format with tree-like hierarchy structure. XML is human readable, just like CSV, but when we look at the XML data, it is more  like a Tree with Branches and Leaves.

<root>
    <object1 attribute1 = "value" attribute2 = "value" attribute3 = "value">
    <object2 attribute1 = "value" attribute2 = "value" attribute3 = "value">
    <object3 attribute1 = "value" attribute2 = "value" attribute3 = "value">
</root>

WHAT XML CONSIST OF?
  • root node, child node, grand child node, and so on. it always has root.
  • tag
  • element(s)
  • attribute(s)
  • attribute value(s)
  • text
If I continue on digging on XML data structure without some examples probably we all can go to sleep. But I will try show you some interesting things soon.

Since XML itself is a little boring to look at and actually does nothing, why do we even need to look at this? One would rather spend time doodling inside Blender already!

Be patient, my friend.

Apparently the data stored in XML structure is easily accessible via Python, just like collection of Dictionary and List. It is a lot like Library actually.

This means with XML, we can easily WRITE OUT and READ IN data. And this is a cool way we can  TRANSFER DATA between any software packages or tools that supports Python. We can make them talk to one another as we can see soon.

The data inside could be anything and we can organize the data the way we like it, because with XML we can create our own custom "tags" and store the data the way we like within the XML structure.

PYTHON AND XML

Python provides many MODULE to work efficiently with XML data.
http://docs.python.org/2/library/xml.etree.elementtree.html

We will be using cElementTree module instead of DOM module.
http://effbot.org/zone/element.htm
http://www.bigfatalien.com/?p=223
http://eli.thegreenplace.net/2012/03/15/processing-xml-in-python-with-elementtree/

SIMPLE VS COMPLEX XML STRUCTURE

There are simple and there are complex XML structure.

A simple XML structure is when we only have 1 level of child under the root/parent.


<?xml version="1.0" ?>
<character>
  <pCube1 rotateX="0.0" rotateY="0.0" rotateZ="0.0" scaleX="1.0" scaleY="1.0" scaleZ="1.0" translateX="0.0" translateY="6.36026310449" translateZ="0.0" visibility="True" />
  <pCube2 rotateX="0.0" rotateY="0.0" rotateZ="0.0" scaleX="1.0" scaleY="1.0" scaleZ="1.0" translateX="0.0" translateY="12.8163721197" translateZ="0.0" visibility="True" />
  <pCube3 rotateX="0.0" rotateY="0.0" rotateZ="0.0" scaleX="1.0" scaleY="1.0" scaleZ="1.0" translateX="0.0" translateY="12.8163721197" translateZ="0.0" visibility="True" />
</character>


OR



<?xml version="1.0" ?>
<character>
  <MASTER rotateX="0.0" rotateY="0.0" rotateZ="0.0" scaleX="1.0" scaleY="1.0" scaleZ="1.0" translateX="0.0" translateY="0.0" translateZ="0.0" />
  <simplebot_lf_knee_pv_ctrl lfLegIkCtrl="0.0" snapKnee="0.0" translateX="0.0" translateY="0.0" translateZ="0.0" />
  <simplebot_rt_knee_pv_ctrl rtLegIkCtrl="0.0" snapKnee="0.0" translateX="0.0" translateY="0.0" translateZ="0.0" />
  <simplebot_rt_foot_ctrl ankleStretch="0.0" fkVis="False" ikFkBlend="1.0" ikVis="False" kneeStretch="0.0" legStretch="0.0" />
  <simplebot_lf_foot_ctrl ankleStretch="0.0" fkVis="False" ikFkBlend="1.0" ikVis="False" kneeStretch="0.0" legStretch="0.0" />
  <COG rotateX="0.0" rotateY="0.0" rotateZ="0.0" translateX="0.0" translateY="0.0" translateZ="0.0" />
  <L_FOOT rotateX="0.0" rotateY="0.0" rotateZ="0.0" translateX="0.0" translateY="0.0" translateZ="0.0" />
  <simplebot_lf_heel_ik_ctrl ballTwist="0.0" footBreak="40.0" footRoll="0.0" legTwist="0.0" maxStretch="3.0" pvControl="True" stretchyLeg="0.0" toeRoll="0.0" toeTwist="0.0" />
  <R_FOOT rotateX="0.0" rotateY="0.0" rotateZ="0.0" translateX="0.0" translateY="0.0" translateZ="0.0" />
  <simplebot_rt_heel_ik_ctrl ballTwist="0.0" footBreak="40.0" footRoll="0.0" legTwist="0.0" maxStretch="3.0" pvControl="True" stretchyLeg="0.0" toeRoll="0.0" toeTwist="0.0" />
  <REye_ctrl translateX="0.0" translateY="0.0" translateZ="0.0" />
  <LEye_ctrl translateX="0.0" translateY="0.0" translateZ="0.0" />
  <JG_Eye_GP eyeZ="0.0" translateX="0.0" translateY="0.0" translateZ="0.0" twist="0.0" />
</character>



They may be slightly hard to read, but still human readable and our brain can see the pattern of what it is trying to do.

A complex XML structure is when we store every values inside child of child. Here is example I took from:
http://www.w3schools.com/dom/dom_nodes.asp

<bookstore>
  <book category="COOKING">
    <title lang="en">Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.00</price>
  </book>
  <book category="CHILDREN">
    <title lang="en">Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
  </book>
  <book category="WEB">
    <title lang="en">Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
  </book>
</bookstore>


I reckon that the complex XML is more "correct", but then the simple XML, the single liner that can be accessed as Dictionary is sufficient for us most of the time. It is really up to us how we like to store and organize the XML.

PS: Shaun Friedberg suggested the simple XML structure. Shaun is actually the one introducing me to this XML stuff (in Maya).

CREDIT NOTE:
Originally some of the contents I talked about in here is from the Python course taught by Shaun Friedberg
http://www.linkedin.com/in/pyrokinesis

WRITING XML (EXPORT XML DATA)

Whatever value we can print() in Python, we can easily pass that as XML lines.

We could type the XML lines by hand manually, but that is silly and we definitely will not do that unless we are a robot. We could of course edit the XML by hand too if we like, but that is also something we don't usually do.

We certainly use Python and LOOP to write XML.

Some module to help writing and parsing XML:

  • ElementTree
  • cElementTree
  • dom
It will be beneficial if you search and study some Python example to write and read XML using the above modules. In our case, we will be using cElementTree, because it seems to be the fastest.


BLENDER SUSHI SCRIPT: Writing Out XML Doodle Script


'''


Preparing XML construct and Writing out XML


Based on teaching by Shaun Friedberg


Edited by Jimmy Gunawan (Blender Sushi)


'''





from xml.etree import cElementTree as ElementTree

# PRETTY PRINT
# function to pretty print the XML code
def prettyPrint(element, level=0):
'''
Printing in elementTree requires a little massaging
Function taken from elementTree site:
http://effbot.org/zone/element-lib.htm#prettyprint

'''
indent = '\n' + level * ' '
if len(element):
if not element.text or not element.text.strip():
element.text = indent + ' '

if not element.tail or not element.tail.strip():
element.tail = indent

for element in element:
prettyPrint(element, level + 1)

if not element.tail or not element.tail.strip():
element.tail = indent

else:
if level and (not element.tail or not element.tail.strip()):
element.tail = indent

return element



# Create ROOT node
rootNode = ElementTree.Element('root')

### CREATE FIRST LINE OF ELEMENT

# Create node = CHILD element
elementNode = ElementTree.Element('node')

# Parent CHILD node to ROOT
rootNode.append(elementNode)

# Adding attribute
elementNode.attrib['exampleAttribute'] = 'example value'

# Adding more attributes
elementNode.attrib['color'] = 'Blue'
elementNode.attrib['smell'] = 'Ocean'
elementNode.attrib['eat'] = 'Sushi'

# Adding text
elementNode.text = 'this is an example text'

### CREATE SECOND LINE OF ELEMENT

# Create node = CHILD element
elementNode = ElementTree.Element('node2')

# Parent CHILD node to ROOT
rootNode.append(elementNode)

# Adding attribute
elementNode.attrib['exampleAttribute'] = 'example value'

# Adding more attributes
elementNode.attrib['color'] = 'Red'
elementNode.attrib['smell'] = 'Fire'
elementNode.attrib['eat'] = 'Spice'

# Adding text
elementNode.text = 'this is second example text'



### WRITING OUT IN A CLEAN WAY IS A BIT COMPLEX... WE USE THE PRETTY PRINT

# Pretty print the rootNode
prettyPrint(element=rootNode)

# We need to convert to STRING before we can see the whole thing
xmlText = ElementTree.tostring(rootNode)

# FINAL RESULT, we need to append the HEADER
print ( '<?xml version="1.0" ?>\n{xmlText}'.format(xmlText=xmlText) )

### NOW WE LIKE TO WRITE OUT THE XML TO FILE
outputPath = r'C:\pythonInBlender\test.xml'

fileObject = open(outputPath, 'w')
fileObject.write('<?xml version="1.0" ?>\n' + xmlText.decode('utf8'))
fileObject.close()

print('XML file has been written in here: {outputPath}'.format(outputPath=outputPath))







RESULT:



Additional Reference:

READING XML (IMPORT XML DATA)

Reading data is much simpler than writing. Well, at least it seems so. Writing data seems to be more complicated at first glance.

What we need to care is what we are going to do with the data after being exported. We also need to do some Data Conversion sometimes because all the data seems to come in as String, where sometimes we need data as Integer or Float for further processing.

The data comes in as Dictionary type of data. Hopefully you have some understanding of Dictionary in Python. I am also still new to all this and it is a matter of getting the KEY and VALUE from each ITEM per ELEMENT.


BLENDER SUSHI SCRIPT: Reading In XML Doodle Script



import bpy


from xml.etree import cElementTree as ElementTree





xmlPath = 'C:/pythonInBlender/mayaOut.xml'


xmlRoot = ElementTree.parse(xmlPath).getroot()





def createMonkeyFromData():


    for element in xmlRoot:





        objectName = element.tag


        if 'translateX' in element.keys():


            #print( 'Attribute called TranslateX: {name}'.format(name=element.get('translateX')) )


            locX = float(element.get('translateX'))


            locY = float(element.get('translateY'))


            locZ = float(element.get('translateZ'))


            bpy.ops.mesh.primitive_monkey_add( location=(locX, locY, locZ) )





createMonkeyFromData()








import bpy
from xml.etree import cElementTree as ElementTree

xmlPath = 'C:/pythonInBlender/mayaOut.xml'
xmlRoot = ElementTree.parse(xmlPath).getroot()

def createMonkeyFromData():
    for element in xmlRoot:

        objectName = element.tag
        if 'translateX' in element.keys():
            #print( 'Attribute called TranslateX: {name}'.format(name=element.get('translateX')) )
            locX = float(element.get('translateX'))
            locY = float(element.get('translateY'))
            locZ = float(element.get('translateZ'))
            bpy.ops.mesh.primitive_monkey_add( location=(locX, locY, locZ) )

createMonkeyFromData()



BLENDER XML BUILDER?
There is a script called xmlbuilder.py inside Blender, I am curious what this actually does. I will check this when I have time. Or you can check it. Maybe it is something to do with DAE (Collada) in Blender.

In the mean time, I will use the WRITING XML and READING XML construct like above.

CASE STUDY: Maya to Blender via XML


Comparison of Python in Maya and Blender
I have to admit that Maya provides a lot more (shortcut) commands that allow users to quickly get ATTRIBUTE or VALUE data from one object (or node in Maya).

A little bit information:
At the current state, Python in Maya is well-known as "Wrapper" of MEL (Maya Embedded Language) programming. MEL has been there in Maya for years, before later Python came in.

MEL scripts itself has hundreds of handy scripts to access all kind of data from nodes. But, even so, Python handles "Strings" and "List" like in a really awesome ways, and this makes writing script is surprisingly easy and data flow is becoming a breeze in Maya.

It will be a little weird for people learning Python in Maya because they have to always look at the MEL first. They need to kind of learn MEL too, at least to really understand the functions and reading the history.

There is PyMEL from Luma Pictures that allow for more Pythonic way to access data, kind of the more correct way Python should implemented in Maya. This is more like how Python in Blender works. It is all Object Oriented (OOP).

There are some Python API that allows to access some Maya's core that normally only accessible using C++ programming. But it is pretty complicated and low level and I am not familiar with those yet.

I am still new to Python in Blender and Blender BPY stuff and still getting familiar with the construct. I am definitely not 100% sure with a lot of things BPY. Meaning, I have a lot of questions regarding the API itself.

Like I said earlier, it seems to be much easier to access DATA inside Maya.

Examples of some handy "commands" in Maya:

  • List
  • Select
  • Get Attribute
  • Set Attribute
  • Connect Attribute
  • List Attribute
  • xform

Blender Python "does not" come with all those kind of commands. BPY feels more "raw" in my opinion.

Users may actually write their own COMMANDS that can mimic all those handy tools that are given from Maya commands.

In Blender, you are accessing the data and value more directly. In Maya, they give some commands to access the data and value in more handy kind of way.


Exporting data From Maya To Blender using XML
Let's take a look at example that I tested the other day.

I am inside Maya and I have 3000 cubes created using Python in Maya, which was based on 3000 Particle POSITION and COLOR. The Particle itself inherited its Colors from Procedural RAMP texture.



You can read a bit more at my Maya blog:

http://mayaspiral.blogspot.com.au/2013/04/python-getting-particle-rgbpp-and-apply.html


In Maya, it is super easy to query ANY Attributes and Values of Particles, including custom attributes per Particle that user created.

In Blender, we can also easily get Particle Attributes such Position, Size, etc. but still pretty limited at the current state. Blender unfortunately cannot access Particle Color by its index. Not at the moment, but I think pretty soon in the future. Fingers crossed.

EXAMPLE: Blender Particle, get position, create cube at position
For example, if I want to create some bunch of cubes at Particle Position, we could so something like this:


import bpy

obj = bpy.context.active_object
ps = obj.particle_systems.active
#ps.particles[0].location

def printPosition():

    for i in range(len(ps.particles)):
        location = ps.particles[i].location
        print(i, location)
        
        # Create Cube At Position
        bpy.ops.mesh.primitive_cube_add(location=(location[0], location[1], location[2]))
        selectedObject = bpy.context.selected_objects
        selectedObject[0].name = 'pixelcube.%s' % i
        selectedObject[0].scale = 0.45, 0.45, 0.45


Now, the reasons I am doing the XML data export from Maya to Blender are below:

  • Because I want to get more familiar with Python and XML data export import
  • Because Maya's Bullet is currently sucks. It is very limited and slow.
  • Because Blender's Bullet is awesome and fast.
  • Because I am thinking of Pipeline where Blender can be the Renderer, Compositor, etc. And I like the practical Blender Fire and Smoke and some more VFX things.


And so I wrote script that does the exporting of some specifc datas from some nodes (every objects in Maya is nodes).

Basically from the 3000 cubes, I exported the COLOR RGB information. That is what I need. I could export the POSITION data as well, but for that I actually just use DAE Collada. Same thing.

How example XML data from Maya looks like:
Simple Tree View in Chrome

The actual XML Data



Importing data Into Blender From Maya using XML
As the data is now "outside" of Maya as XML, we can do anything with it.

I bring the 3000 cubes from Maya as Collada DAE, Blender import them fine with the node names in tact and including Material that was set in Maya. Make sure the Unit Size is checked.

I wrote the script below to READ the XML data.

XML, Dictionary, Strings
XML, when imported will come as Dictionary type of data. And it is also STRING type of data. I imported the RGB like this "[0.124, 0.55, 0.123]" and they are strings. Where the data expected supposed to be 3 values of Float.

In my script below, I have noob attempt to convert 3 values string into 3 values float.



BLENDER SUSHI SCRIPT: Importing RGB via XML (but you need to setup the XML)


import bpy
# import xml.etree.ElementTree as ET
from xml.etree import cElementTree as ET

def applyColor(object='pCube999', rgb = [1.0,0.0,0.0]):
# Get specific object
object = bpy.data.objects[object]

# Create new vertex color
object.data.vertex_colors.new()

# Get Total Length of Vertex Colors for each selected meshes
totalVertCol = len(object.data.vertex_colors[0].data)

# Iterate over every mesh vertex color and give it a single colour
for i in range(totalVertCol):
object.data.vertex_colors[0].data[i].color = rgb

filepath = 'C://xml//test.xml'
tree = ET.parse(filepath)
root = tree.getroot()

print(root.tag)

# root = ET.fromstring(country_data_as_string)

for child in root:
# Get node name
nodeName = child.tag

# Get Dictionary (including key and value)
dict = child.attrib

# Extract value from Dictionary
rgb = dict.get('rgbVal')
rgbClean = rgb.strip( '[]' )
rgbList = rgbClean.split(',')
rgbColor = float(rgbList[0]), float(rgbList[1]), float(rgbList[2])
print (rgbColor)

applyColor(object='{nodeName}'.format(nodeName=nodeName), rgb = rgbColor)













Thanks again to Taisuke Tanimura and his magic of list comprehension, there is a better way of doing that 3 values String RGB into correct 3 values FLOAT:

rgbList = [float(token) for token in rgbVal[1:-1].split(',')]

Big thanks to:


 COMING SOON (HOPEFULLY)

  • XML to save poses and presets of objects
  • XML for assembly and layout between 3D packages
  • XML for saving animation and simulation data

 OTHER LINKS

This is a kind of old trick that I might or should have shown to you sometimes in the past. I apologize if I was repeating the technique a little bit, but I think I will do it again anyway.

I think I can further expand the idea on how to distribute and position objects along Curve path:
  • The Procedural / Semi Manual Way
  • The Blender Python Way
This is probably the accumulation of some techniques that I have written in the past. It is like doing the same thing, but think of it in more sophisticated way. 

"Position Along Curve" inside Maya

I have to show you this first, so you have better idea on what I am trying to do inside Blender.

There is this once-off-tool-function  in Maya that allows user to position bunch of selected objects nicely along the active curve. This tool is actually build in Python:


I feel challenged to translate this Python tool from Maya for Blender using Blender Python. I have to look around first to see whether somebody out there already create it, so far I could not actually find it.

I thought this tool is very handy, but also a little bit stupidly implemented in Maya because it only does it in non-procedural way. The tool does the job, but it does not even have the option to align the object based on the direction of the curve.

Of course I am sure it is possible to create a setup in Maya where things can be more procedural and the effect is alive, but it does not come out of the box.





If you want to have a look further on "Position Along Curve" and its application in Maya:
http://lesterbanks.com/2012/08/tips-for-aligning-objects-along-a-curve-in-maya/
https://vimeo.com/48139021

"Rebuild Curve" inside Maya and Houdini

One thing though, Maya has nice Rebuild Curve, that simply does the job of resampling and rebuilding curve. Even so, Houdini actually does this kind of thing better with its Resample node.
Maya Rebuild Curve
Houdini wins in this case. There is no simpler way of curve resampling than how Houdini does it:
Houdini Curve Resample
I really think Blender needs Modifier that does this LIVE Curve Resample exactly. Hopefully in near future. It's my wishlist for years. Otherwise someone needs to come up with one whether it is in form of Python Script or Modifier.

Although Blender has Simplify Curve add-on, but it is not sufficient.


SORRY, THIS IS NOT "TANK THREAD" TUTORIAL

You may think that this is how to do Tank Thread tutorial using:
  • Array Modifier
  • Curve Modifier
  • Curve
No, this is not "Tank Thread" tutorial. But do Google for "Blender Tank Thread" tutorial, it's pretty cool and the effect is LIVE. It is a way you can place an array of duplicated objects (normally same object) along a curve just like Tank Thread.



POSITION ALONG CURVE & REBUILD CURVE IN BLENDER 
(THE SEMI PROCEDURAL WAY)


This seems to be the old way of doing it before Blender 2.5x
http://www.blendernewbies.com/tutorials/video/even_distrib_verts/even_distrib_verts.html

Some of those old techniques are still applicable, such as DupliVerts and DupliFrame.

It's a lot easier to do with latest Blender and we can extend it further with Particle Instancer.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Modeling/Objects/Duplication/DupliFrames

Please do the step-by-step tutorial above on Blender Wiki, it should be quite clear. So you can basically do duplication of objects along curve.

I will do the same, but using Grease Pencil as the start, because I want to point out some quirk that Blender has that you may not know.

1. Draw a Curve using Grease Pencil.

2. Convert Grease Pencil into Curve object
You can read more funky stuff about this Grease Pencil into Geometry:
http://wiki.blender.org/index.php/Doc:2.6/Manual/3D_interaction/Sketching/Converting_to_geometry


The resulting curve is of course not very efficient, often too dense.

Perhaps you want to Simplify Curve (activate it from Add-On) first. We don't worry about even spaced Resampling for now. We just want a simpler looking Curve.

3. Simplified Curve

The result of Simplify Curve tends to be slightly smoother, which is nice. The simplified curve does not have evenly distributed points though.

4. Duplicate Objects using DupliFrame
Now, we like to have a Dummy Object as our placeholder where we like to Position Objects Along Curve at later stage. Our Dummy can be just a scaled Cube for now. We will replace it with A Single Vertex later.

You should be able to do this by following the Wiki. Make sure:
  • Curve Scale is applied, otherwise the Object that is Parented and DupliFrame is gone crazy and disappear from the 3D scene.
  • Object to DupliFrame needs to also be reset to origin and placed at the Start of Curve.
  • Speed option under DupliFrame is turned off
  • Path Animation is turned on under Curve Tab.
  • DupliFrame total frame number matches the Path Animation total frames.

So you got something like below. Easy.
32 frames DupliFrame, Follow ON
You can also have something like below, if you turn off the Follow option.

32 frames DupliFrame, Follow OFF
At this stage, you can do Resampling as you pleased.

64 frames DupliFrame, Follow ON

5. Switch Data
You can switch the Data of the object into something else, like Suzanne (Suzanne is always a good reference for object orientation) if you like:


However, for our purpose in distributing and positioning bunch of Objects along Path, we do not really need to worry about that.

6. DupliFrame A Single Vertex
I always think the way Blender handling Single Vertex is pretty awesome. Almost like Point in Houdini. A single vertex of Polygon in Blender is regarded as a real thing.

Turn your DupliFrame duplicate objects into a Single Vertex.


Although we lost the "procedurality" of being able to change the sampling, this is also the step when thing gets exciting.

You are probably already guessing where I am going with this.
BLENDER MANUAL CURVE RESAMPLE:



If you connect the dots (Vertex) in order, as Edge (select 2 vertices and tap F), you are going to end up with a Curve that with even space sampling.

Instead of doing it manually, we can use Python for that:

import bpy

### 1. GET VERTICES POSITION IN 3D ###

ob = bpy.data.objects['myVerts'] # assuming there is an object named "myVerts"

verts = ob.data.vertices

vertData = []

for vert in verts:
    print(vert.co)
    vertData.append(vert.co)

### 2. THE RE-CONSTRUCTION OF EDGE MESH ###

scn = bpy.context.scene

# Create Mesh Data
myMesh = bpy.data.meshes.new('myMesh')

# Passing some XYZ data for Vertex Location
#vertData = [(0,0,0), (0,4,0), (4,4,0), (4,0,0)]

# Connect pair of Vertices data as Edges based on list order of vertices
edgeData = []

a=[]
b=[]

for number in range(len(vertData)-1):
    a.append(number)
    b.append(number+1)

edgeData = list(zip(a, b))

faceData = ()

# Finally putting all the information together into Mesh Object
myMesh.from_pydata(vertData, edgeData, faceData)

meshOb = bpy.data.objects.new('myOb', myMesh)

scn.objects.link(meshOb)




  1. Grease Pencil Stroke (convert to dense Curve)
  2. Simply Curve
  3. Dupliframe a single vertex within certain distance
  4. Connect the Dots (connecting points using Python), assuming the point is in order (it should be)
  5. Apply Skin Modifier

However, we does not stop there. We will continue and use Blender Particles to easily do the BEADS like distribution, this is piece of cake since we already have nicely distributed Points.

BLENDER POSITION ALONG CURVE (THE SEMI PROCEDURAL WAY)

7. Blender Particles and Instances to Distribute Objects
We learn in the past that Blender Group can be used as Instance object for Blender Particles, which is really cool in itself.

We simply create some beads for example, I will do my usual Colorful Beads:


Group the Beads in order and then Instance it to the Points, I will highlight all the important values you need to change:


So you get something like this:

You can activate Instance Random and play with the Seed Value of course:


Those guys instanced are really Particles, so you can play around further with that and the Instance will follow. What is cool is that you still have control over the Object being distributed along curve Path.

8. Particle Instance Modifier for other object
The Point Cloud mesh that is emitting Particle and distributing Group of objects still have Vertex Normal information along curve. This can be proved if you actually apply Particle Instance Modifier into another object, like Monkey for example:



The original Particle Orientation can be adjusted. Although limited.



What would be nice is to be able to do all that directly by using Python. This is definitely a really good Python exercise to do because it will be involving LIST and SLICE.



POSITION ALONG CURVE & REBUILD CURVE IN BLENDER
USING LOOPTOOLS GSTRETCH X GREASE PENCIL COMBO
(THE HACKY BLENDER SUSHI WAY)


Knowing the method above, we can probably use Blender Python script tools out there that does similar kind of thing.

I stumbled into this GStretch feature of LoopTool by Bartius Crouch (LoopTools is available as internal Add-Ons on every Blender)
https://sites.google.com/site/bartiuscrouch/looptools

GStretch does the thing that I wanted, which is to "evenly place position of points on Grease Pencil". I will probably study the Python script of this GStretch and found out how Crouch does it.

Anyhow, I am using GStrech (feature of Loop Tools) like this:
0. Make sure you already install and run Loop Tools Add On from User Preferences.

1. Draw a line and give it subdivision numbers that you like, the total subdivision will account as the "Curve Sample". For example:

  • A Line (with 2 vertices) = 1 Edge Sample.
  • A Line (with 2 vertices), subdivided cut 10 times = 11 Edges Sample, 12 vertices
  • A Line (with 2 vertices), subdivided cut 32 times = 33 Edges Sample, 34 vertices
Let's try small number like 10 Cuts of Subdivision for now:



3. Now, quickly draw your Grease Pencil freehand stroke as you like anywhere in 3D space.

4. Next, while still in Edit Mode and having all the vertices selected, simply call GStretch function by tapping Space and find GStretch.


5. Magically the selected Line Vertices will snap evenly along the Grease Pencil!


6. Now, it is easy to place some objects evenly spaced along the Curve! (using DupliVert or Particle Instancer for more sophisticated arrangement)

Here is video tutorial for this hacky technique:


NOTE:
  • Watch out for the Vertex Orders of line. You probably want to Sort the Vertex Point orders of the Line before doing this so that your placement of objects is exactly as you want.
  • This way will work, but it is hacky and require some strange procedures. I supposed the best way is to just use Python Script.
Additional Explanation from Bart regarding GStretch in LoopTools:

The basic methodology of GStretch is the following: getting the user input, which consists of some connected selected vertices and a grease pencil stroke. It does some checks to match up which vertices will have to go to which stroke, as it accepts multiple simultaneous inputs, but you do not need to be worried about that. It then calculates the total length of the grease pencil stroke (simple math, using the coordinates of the stroke points) and creates a list with the cumulative distance from the start to each stroke point. For each vertex, the relative position along the stroke is calculated (e.g. 10%). Using the list of cumulative distances it determines between which two stroke points the vertex will need to be moved to and how far along that line. It all sounds a bit abstract, but I would suggest studying the functions "gstretch_eval_stroke()" and "gstretch_calculate_verts()".

The basic methodology can be adapted to many situations, for example to evenly spreading objects along the curve, instead of single vertices.

UPDATE 2014.03.12:

On the note of SPACING vertex along currently selected Vertex, along Path, you can also use the Space function of LoopTools.


Found that by accident while studying this cool videon on how you do retopology in Blender:
https://www.youtube.com/watch?v=icqPZnD_3lA

Smoothing and resampling is slightly more tricky. You would have to calculate a curve through the stroke points, probably using some kind of resolution parameter and a non-linear least squares regression. It's possible, but it's probably easier to use Blender's built-in methods for that, or do some object type juggling. E.g. grease pencil -> mesh -> smooth (or relax) -> curve -> grease pencil.

Thanks to Bart Crouch and his awesome LoopTools//GStretch!



POSITION ALONG CURVE & REBUILD CURVE IN BLENDER 
(THE PYTHON WAY)

On previous blog post, I already touched on how to create Box on selected Vertex position:
http://blendersushi.blogspot.com.au/2013/03/python-list-and-modify-values.html

If we just want that, we can have it right away. But this is too simple, not much of options and the result is just newly created polygon boxes position along the curve (Vertex/Point positions).


We can modify the Python script above so that it will:
  • Place bunch of user selected objects into their new position along Curve Path. The objects could be the same total number or less. Blender should repeat and duplicate the list of objects if required.
  • Create bunch of objects in a LIST into the Curve Path (which is now simply Vertex/Point positions)
  • Randomize or reorder the LIST using Python
  • Aligning the objects in the LIST based on Normal direction.
  • Adjusting the Points, maybe create script that Connect Closes Points, or something similar.
In a way, Python code is used here to modify Points and we are using that Point data (positions) to do the placement of objects. This is all rather basic, but a good exercise for beginner Python artists (like me).

What would be really nice is if we can simply "Draw Curve" using Grease Pencil and let Python all the steps above. Maybe we can even write Python scripts that "Draw Random Curves" on Mesh. 

Since in Blender we don't have all Node Based System for Geometry and Particles (yet), for now we rely on Blender Python. I have to say this business of modifying Points using Python is actually quite fun...

<< Now, I am doing research on how to do this using Python script .... please come back later >>

UPDATE 2013.07.03, SEE ALSO: 
Armature Bone Sketching aka Etch-A-Ton
http://wiki.blender.org/index.php/User:Theeth/etch-a-ton
http://aligorith.blogspot.com.au/2013/01/obscure-blender-features-skeleton_29.html
http://wiki.blender.org/index.php/Doc:2.6/Manual/Rigging/Armatures/Editing/Sketching


RESEARCH
http://www.morethantechnical.com/2012/12/07/resampling-smoothing-and-interest-points-of-curves-via-css-in-opencv-w-code/

To Be Continued.....

MKRdezign

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget