Halloween Costume ideas 2015
Articles by "reading"
@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


I have a lot of books. Despite a cross-country move a few years ago that involved a massive book cull, I still find myself with three overstuffed bookcases, loaded shelves, no fewer than two books on my bed while I sleep, and several piles of books around my apartment, on the floor. 

A visiting friend observed my book collection and told me about a Japanese word, tsundoku. It translates to collecting literal piles of books you don’t read. 

I started to develop some shame around my tsundoku; all those books I was buying without reading. I subsequently made a rule for myself that I wouldn't buy another book until I began whittle down my piles. I had gotten to the point where I was buying books constantly, including through Instagram, and felt like I should probably slow things down. 

Then I came across an essay by Umberto Eco called How to Justify a Private Library about why you should have a library of books you don’t read; why you should have tsundoku: 

 “...There are still people who consider a bookshelf as a mere storage place for already-read books and do not think of the library as a working tool… I believe that, confronted by a vast array of books, anyone will be seized be the anguish of learning...” 

I no longer felt shame about my tsundoku because to me they represented potential; new ways to learn, grow, inform my practice, enrich my perspective, and add tools to my toolbox. A library as a working tool. 

I started to ask some fellow kidlit folks about their tsundoku, and not surprisingly, many of them had them. Here's what's current:

Robin Rosenthal, also an author at Pen & Oink









Sarah Jacoby, who added, “I'm trying to do a couple things with this pile of books by my bed. Two book recent covers have caught my attention: Klassen/Pennypacker's Pax and Peter Brown's The Wild Robot. Now I want to know all about what's going on with middle grade books. Other than the Wildwood Chronicles, I haven't paid much attention to the genre lately but now, given how gorgeous these books are, I'm very curious. So after I read Pax and The Wild Robot, I'm planning on re-reading Madeleine L'Engle's  A Wrinkle in Time series, A Gift of Magic by Lois Duncan, and The Brother's Lionheart  by Astrid Lindgren-all books that I recall being completely entranced by when I was of middle grade age…”

And Katie Kath wrote up her list:
  • The Biblical Canon: It's Origins
  • Transmission and Authority
  • Moby Dick
  • Art and Beauty in the Middle Ages
  • The Once and Future King
  • The Murder of William of Norwich
  • Dr. Syn On The High Seas


Maybe in a way these tsundoku represent the ways we’re all exploring and growing. I was excited about pulling these lists together and talking about them with their owners. Often we chatted about each other’s lists (“that book is amazing” or “I always wanted to read that!”). 

What is your tsundoku?


-------------------------------------------------------------------------------------






K-Fai Steele is a writer/illustrator based in San Francisco. She writes and draws with watercolor and ink about anthropomorphized animals who find themselves in sticky situations. 

Follow her on instagram or twitter.

In previous post, I talked a lot about XML and probably some of you got confused on how we can really use this XML writing and reading knowledge to do export import of data.

This is fine because with the XML Read and Write, you really have a lot of concepts to digest:
  • Using Element Tree XML built in module
  • Concept of XML: tag, element
  • Using File function of Python to write out to file
  • Using and constructing data that is like Dictionary: keys, items, values
  • Data type conversions
  • Understanding of Path Location of XML file in your Operating Systems
This XML concept is also still fairly new to me and I only understand the basic to write out the XML style format and read it back in.

Take it easy and slowly with this XML. See the pattern.

However as we know, even the basic knowledge can be really useful. I will further expand the idea from previous post. Feel free to ask me questions if you don't have clue what I am talking about.

DIY Write & Read of XML

For this, I will start by copying and pasting the template construct from previous post on XML and modify it slightly each time for each example below. It would be better to understand the xml.etree module, but we could also simply use the construct as long you know what it does in the background.

We will definitely use some simple BPY to collect information and data we needed to export about the 3D scenes. Our focus is on how the data can flow out of Blender and bring it in back into Blender or to other 3D packages.

Remember that Python scripting, like any other programming language, is something you learn and master by actually practicing it and making mistake and fixing it.

If you understand my style of blog writing, I actually improvise while writing. Often I do not actually plan the topic. This blog is more like Journal. I explore certain feature, I am testing and documenting each steps and then I will write it down. I guess you could do the same thing.

Hopefully with this examples, you can start to get curious and try your own XML export import.

It will get easier every time you try it yourself. My examples are there to assist you. Try doing the same thing without looking at my examples and you will start to understand.

Keep digging the Python language and Python in Blender, it will be worth it.

EXAMPLE 1: XML Transform Information (Position, Rotation, Scale) of objects

The idea is to get the Name, Translations, Rotations and Scales data of every selected objects and writing it out as XML. Below is such example of code. It can be optimized, but below should work and the code is pretty easy to read.

Maybe I have bunch of Boxes in random Position, Rotation, Scale in Blender that I want to export out as XML data.



WRITE OUT:


'''
Taken from: Blender Sushi Blog
Code by: Jimmy Gunawan
Last update: 20130420
'''





import bpy
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

### Collecting some information data about the scene ###

# In this example we collect the selected object Transforms
# aka Position (Translation/Location), Rotation, and Scale XYZ
# and writing out the data as XML format

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

# Get Selected Objects
selected_objects = bpy.context.selected_objects

for object in selected_objects:
myLocs = object.location
myRots = object.rotation_euler
myScales = object.scale

# Create node = CHILD element
elementNode = ElementTree.Element('{object}'.format(object=object.name))

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

# Adding attribute translations
elementNode.attrib['TX'] = str(myLocs[0])
elementNode.attrib['TY'] = str(myLocs[1])
elementNode.attrib['TZ'] = str(myLocs[2])

# Adding attribute rotations
elementNode.attrib['RX'] = str(myRots[0])
elementNode.attrib['RY'] = str(myRots[1])
elementNode.attrib['RZ'] = str(myRots[2])

# Adding attribute scales
elementNode.attrib['SX'] = str(myScales[0])
elementNode.attrib['SY'] = str(myScales[1])
elementNode.attrib['SZ'] = str(myScales[2])

# Adding text
elementNode.text = '{object}'.format(object=object.name)


### 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\transOut.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))









THE XML:



READ IN:


'''
Taken from: Blender Sushi Blog
Code by: Jimmy Gunawan
Last update: 20130420
'''





import bpy

from xml.etree import cElementTree as ElementTree

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

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


def applyTransform():

for element in xmlRoot:

# Get the NAME of objects
objectName = element.tag
print(objectName)

# Tell Blender to get the current object data by its name
object = bpy.data.objects['{objectName}'.format(objectName=objectName)]
print(object)

# Get all element keys
myKeys = element.keys()
# print(myKeys)

# Get Position, Rotation and Scale data
posX, posY, posZ = float(element.get('TX')), float(element.get('TY')), float(element.get('TZ'))
rotX, rotY, rotZ = float(element.get('RX')), float(element.get('RY')), float(element.get('RZ'))
scaleX, scaleY, scaleZ = float(element.get('SX')), float(element.get('SY')), float(element.get('SZ'))

# Apply Position, Rotation and Scale data to corresponding object by its name
object.location = posX, posY, posZ
object.rotation_euler = rotX, rotY, rotZ
object.scale = scaleX, scaleY, scaleZ

applyTransform()









The code above is very specific about Object Name and that is just one way we can do this. If for the same objects we reset their position, we can then run the script and magically put them back into positions specified from XML.

The above example is not particularly amazing example because we can achieve the same thing using DAE Collada Export Import, for example. Although with DAE, we usually have limited options and flexibility.

We could bring the XML data to other 3D package and actually do ANYTHING with it. Keep in mind that the World XYZ Orientation might be different in other package.

This kind of code is probably good for saving out "Presets"or maybe "Character Poses". I have not looked at it deeply. It has potential for Assembly script. Although Blender File System and Referencing are actually already pretty cool and we can probably do the script based on that system. But if we want to bring it outside and inside other package, then XML seems to be nice.

From the above basic example, we can take the concept to place some Monkeys in the 3D scene, if we can think of every Cubes as Bounding Box:


READ IN, BUT CAST AS MONKEYS:


'''
Taken from: Blender Sushi Blog
Code by: Jimmy Gunawan
Last update: 20130420
'''





import bpy

from xml.etree import cElementTree as ElementTree

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

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


def createMonkeyFromData():

for element in xmlRoot:

objectName = element.tag

if 'TX' in element.keys():

# Get Position Data
posX, posY, posZ = float(element.get('TX')), float(element.get('TY')), float(element.get('TZ'))

# Create Suzanne based at position XYZ
bpy.ops.mesh.primitive_monkey_add( location=(posX, posY, posZ) )

monkey = bpy.context.selected_objects[0]
print (monkey)

# Get Rotation and Scale data
rotX, rotY, rotZ = float(element.get('RX')), float(element.get('RY')), float(element.get('RZ'))
scaleX, scaleY, scaleZ = float(element.get('SX')), float(element.get('SY')), float(element.get('SZ'))

# Rotate and Scale monkey accordingly from data
monkey.rotation_euler = rotX, rotY, rotZ
monkey.scale = scaleX, scaleY, scaleZ


createMonkeyFromData()










NOT EXACT DIMENSION SIZE
We apply the Transform data from the Cubes into the Monkeys, although is not really the accurate Bounding Box or Dimension data. Because some parts of the monkey is poking out.

If you are questioning about it.We could export out the Dimension data as XML from the first place and apply it to the monkeys to get more accurate result.

Example on how to get dimension data of object to pass on:
bpy.data.objects[{object_name}].dimensions
bpy.data.objects['Cube'].dimensions

EXAMPLE 2: Reading In Custom Attribute Data

Let say we have XML data with arbitrary Custom Attribute and values. We did not create the date from Blender. Someone else did it. Maybe we grab the data from the Internet.


The XML data can be anything:
1. Yahoo! Weather XML data
  • City Location
  • Temperature High
  • Temperature Low
  • Today's Date
2. Facebook XML data
  • Person's Name
  • Person's Photo
  • Person's Age
  • Person's Likes
3. Google Map data
  • Latitude
  • Longitude
  • Name of State
  • etc
What we can do is simply READING those data and then visualizing it in Blender. 

A simple example, XML like below:

<world>

<Object1 COLOR="red" SIZE="5.0"/>

<Object2 COLOR="green" SIZE="2.0"/>

<Object3 COLOR="blue" SIZE="0.5"/>
</world>

OR MORE PROPERLY:

<?xml version="1.0" ?>
<world>
  <Object1 COLOR="red" SIZE="5.0"></Object1>
  <Object2 COLOR="green" SIZE="2.0"></Object2>
  <Object3 COLOR="blue" SIZE="0.5"></Object3>
</world>

(Save the bottom one as customData.xml.)

Ok, let say from those data, I will apply it to the Monkey.001, Monkey.002, and Monkey.003 objects in the 3D scene that I have prepared.

The Suzanne Three Sisters
What I am trying to do is to tell Blender:
Object1 --> Monkey.001 --> apply SIZE, apply MATERIAL with Diffuse Color = COLOR
Object2 --> Monkey.002 --> apply SIZE, apply MATERIAL with Diffuse Color = COLOR
Object3 --> Monkey.003 --> apply SIZE, apply MATERIAL with Diffuse Color = COLOR

The script can be as below:


READ IN CUSTOM XML


'''


Taken from: Blender Sushi Blog


Code by: Jimmy Gunawan


Last update: 20130420


'''





import bpy

from xml.etree import cElementTree as ElementTree

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

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


def applyColorToMonkey():

for element in xmlRoot:

# Create Materials with Color based on the NAME
colorname = element.get('COLOR')
mat = bpy.data.materials.new(name='{colorname}'.format(colorname=colorname))

# Create our own custom dictionary of color
colorDict = {'red':[1.0,0.0,0.0], 'green':[0.0,1.0,0.0], 'blue':[0.0,0.0,1.0]}

# Assign specified Diffuse Color into Material
myColor = colorDict.get(colorname)
bpy.data.materials[colorname].diffuse_color = myColor

# Get the NAME of objects
objectName = element.tag
objectNumber = int(objectName.strip('Object'))
monkeyName = 'Monkey.{objectNumber:03}'.format(objectNumber=objectNumber)

print (monkeyName)

# Tell Blender to get the monkey data by its name
object = bpy.data.objects['{monkeyName}'.format(monkeyName=monkeyName)]

# Assign our Material to corresponding Monkey
object.data.materials.append(mat)

def applyScaleToMonkey():

for element in xmlRoot:

# Get the NAME of objects
objectName = element.tag
objectNumber = int(objectName.strip('Object'))
monkeyName = 'Monkey.{objectNumber:03}'.format(objectNumber=objectNumber)

print (monkeyName)

# Tell Blender to get the monkey data by its name
object = bpy.data.objects['{monkeyName}'.format(monkeyName=monkeyName)]

print(object)

# Get SIZE data and assign it to Scale Variables
scaleX, scaleY, scaleZ = float(element.get('SIZE')), float(element.get('SIZE')), float(element.get('SIZE'))

# Apple Scale to Monkeys
object.scale = scaleX, scaleY, scaleZ


applyColorToMonkey()
applyScaleToMonkey()







If the above code run as planned, we are getting something like below. This is the power of XML and Python and Python in Blender.

We should be able to:
  • Write XML data (free the data to the ouside)
  • Read XML data (from any source)
  • Process the data
  • Apply the data

The code above can be further cleaned up and probably expanded
  • Error Checking
  • Check if object exist
  • Making sure Blender does not keep generating same Material Name when we run the script multiple times.

FURTHER ON WITH XML

See if you can play with the idea further more:
  • Assigning "specific Texture Name" for each Material to be assigned into "specific" objects
  • Procedurally generate XML data 
  • Can we perhaps use other tool like Processing to generate XML and then bring it into Blender?
  • Turn it into Animation, let say if we have XML data in corresponding to Frame Number.
  • Find some XML data from Internet and bring it into Blender and visualize it.
  • Almost "Real time" XML data with refresh?

OTHER VIDEO TUTORIAL RELATED TO XML

Luiz Kruel @Eat3D

Based from his video tutorial, below is the converted Blender Script that does the XML export using MINIDOM.

from xml.dom.minidom import Document
import bpy

doc = Document()

root_node = doc.createElement("Blender Scene Info")
doc.appendChild(root_node)

# Get selected objects
selection = bpy.context.selected_objects

# Just print out selected objects name
for num, item in enumerate(selection):
    print (num, item.name)

# Add into XML tree:

for object in selection:
    object_node = doc.createElement(str(object.name))
    root_node.appendChild(object_node)

    object_locX = object.location.x
    object_locY = object.location.y
    object_locZ = object.location.z
    object_node.setAttribute("locationX", str(object_locX))
    object_node.setAttribute("locationY", str(object_locY))
    object_node.setAttribute("locationZ", str(object_locZ))
    
print()
print()
print()

xml_file = open("C:/test.xml", "w")
xml_file.write(doc.toprettyxml())
xml_file.close()

print ( doc.toprettyxml() )


Oh, I had soooo much fun making these, so I really hope you enjoy them.  My mom has a fun library of OLD books that have cute vintage graphics in them.  The best part, the copyright is out on some of them.... so I thought I would share just a few of my treasures.

This is a set of 10 Vintage Photoshop Brushes.  They are FREE for Commercial and Personal Use (see the TOU below).

"Vintage Graphics" by Design Forte are free for commercial and personal use.  Files are NOT to be sold as is.  They MAY be used to create items to be sold, but may NOT be sold by itself in it's original form.  I do very much appreciate a link back and/or credit, but it is not required.

If you are interested in posting my freebie, you may link back to my website, but you may NOT offer the direct download on your website.

MKRdezign

Contact Form

Name

Email *

Message *

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