mcjTeleBlender DS1,2,3,4

USERS OF Blender 2.66.3 2.66.5 and after, please get mcjTeleblender 2 here:

https://sites.google.com/site/mcasualsdazscripts3/mcjteleblender2

***************************************************************************

* UPDATE * * UPDATE * * UPDATE * * UPDATE * * UPDATE * * UPDATE * * UPDATE *

***************************************************************************

April 7th 2013 8:15 am

this morning i added a new version of mcjBlendBot that needs to be used

for the latest beta versions of Blender 2.66.3 and above

this new version has a bonus, the world environment maps have a texture

coordinate node which lets you spin the world atound your scene

****************************************************************************

* UPDATE * * UPDATE * * UPDATE * * UPDATE * * UPDATE * * UPDATE * * UPDATE *

***************************************************************************

Version History

November 3rd 2013 Fixed mcjBlendBotForCarrara which was unable to invoke addCamera from the mcjBlendBot module

September 10th 2013

the mcjUseMatLib.py Blender python module was corrected - if the use-mat-lib option is in effect,

but the material-library doesn't contain a given material, a cycles node tree is built anyway -

this is not a perfect patch since it breaks compatibility with non-cycles renders

April 7th 2013 11:42 am

Blender Version 2.66.3 and up uses different node names, this effectively prevents proper loading of the scene please download the package named mcjBlendBotForBlender2663AndUp.zip found in the attachments install it in the scripts/modules folder of your Blender 2.66.3 and up

February 17th 2013

fixes : the materials were not smoothed when rendering animations,

fixes : DS1,DS2 materials didnt get the gloss factor when exporting animations

in the download section, there was a confusion between mcjTeleBlender.zip and mcjTeleblender.zip

February 14th 2013

the "blender scaling factor" which should be 1% ( and not as previously believed, 2% ) is now applied to the positions of the cameras and lights

February 10th 2013

fixed error introduced in the feb 8th version

February 8th 2013

modified mcjTeleblender's "Fix .mtl file for Blender" it now replaces the "mat_refl" keywords with "refl". This was needed because blender's obj importer as of version 2.64 does not support the "mat_refl" tag. This repairs mcjTeleblendere's ability to have "mirror effect" surfaces.

October 22nd 2012

modified mcjBlendBot which failed when the base .blend scene contained un-applied subdivision modifier

October 18th 2012

modified the mcjAddMappersToTexImgs.py module to correct incompatibility arising from changes in version 2.64 of blender (my fault actually),

the new version is part of the mcjBlendBot package named mcjBlendBot_October_18_2012.zip

modified mcjTeleblender, the batch file created when wou press the "Export/open current frame" button used to be useless, it can now be used to (re) launch the render process of that one frame.

when exporting animations, the surface smoothing options were not enabled, which goes to show that almost nobody uses mcjTeleblender for animations :)

june 29th 2012

added a note in the manual about problems that occur when the lib_ trick is used and "collect maps" option is in use

june 26th 2012

mcjBlendBot new material-library system. Texture images tiling

april 20th 2012

fixed a problem with paths that include spaces

april 17th 2012

added Multiply node to the bumpmap node, only one file in the mcjBlendBot.zip package needs to be updated

march 8th 2012

fixed mcjBlendBot.py for Blender 2.62

feb. 20 2010

release

Introduction

A fantastic GPU-accelerated ray-trace renderer named Cycles has been added to recent versions of Blender.

McjTeleblender is a kit of scripts designed to quickly export Daz Studio scenes, even animations, and render them in Blender using Cycles.

Credits

In mcjBlendBot.py, the method to load .obj files was derived from "MeshStreamer" by Tom Harding

http://blenderartists.org/forum/archive/index.php/t-228040.html?s=44176b58969a5e5158d36c15dcf4c38a

Although i didn't read the code, a few years back i stumbled upon MeshFoot by Blenderartists' Atom , so it's probably an influence!

http://blenderartists.org/forum/showthread.php?154134-Meshfoot-OBJ-Sequencer-%28Release-v01a%29&highlight=meshfoot

The code for the setup and use of Daz Studio's internal .obj exporter comes from a post by Rob Whisenant

http://docs.daz3d.com/doku.php/artzone/wiki/user/rbtwhiz/technotes/daz_script/import_export/start#use_script_to_importexport_an_obj_without_displaying_the_option_dialog

Disclaimers and License

DAZ is a Registered Trademark of DAZ Productions, Inc.

Other than being a user of their software i am in not an employee of DAZ Productions, Inc nor The Blender Foundation.

The Scripts herein are released under the MIT License:

Copyright (c) <2011,2012> <mCasual/Jacques>

Permission is hereby granted, free of charge, to any persoration

obtaining a copy of this software and associated documentation

files (the "Software"), to deal in the Software without

restriction, including without limitation the rights to use,

copy, modify, merge, publish, distribute, sublicense, and/or sell

copies of the Software, and to permit persons to whom the

Software is furnished to do so, subject to the following

conditions:

The above copyright notice and this permission notice shall be

included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,

EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES

OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND

NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT

HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,

WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR

OTHER DEALINGS IN THE SOFTWARE.

Installation

This software suite was developed for Blender 2.6x, it may work with 2.5x but probably not 2.4x

http://www.blender.org/download/get-blender/

The installation packages can be found at the bottom of this page.

mcjTeleBlender.zip

This package contains the Daz Studio script mcjTeleBlender,

there's a version for Daz Studio 1 & 2 and a version for Daz Studio 3 & 4

Unzip this file in your Daz Studio content folder

On a typical Windows PC that's C:\program Files\Daz\Studio\Content

mcjBlenderBot.zip

This package contains Python Scripts for Blender:

mcjBlendBot.py, mcjAddSky.py, mcjFixBlenderMats.py,

mcjMakeCyclesNodes.py, mcjGammaFix.py, mcjUseMatLib.py

Unzip this file in your Blender modules folder

On a typical Windows PC that's C:\Program Files\Blender Foundation\Blender\2.60\scripts\modules

mcjgeosender

This plugin for Daz Studio 3 (Windows only) lets mcjTeleBlender export scenes 10 times faster.

it can be found here: https://sites.google.com/site/mcasualsdazscripts/mcjgeosender

Daz Studio 4 users don't need this since DS4 exports as fast as the DS3 plugin

The sample scene

The sample Daz Studio scene roma.daz, contains an animated dancer. Total faces count: 102,000

Transfering a Daz Studio scene in blender

Launch mcjTeleBlender

if you installed it correctly it should be found in your daz library in Studio / Scripts / mCasual

Specifying the export file

In the Export section, click on the first "Browse" button,

Specify the location and name of the file that will be used to transfer the scene.

In the example below, i created a folder named roma in my F:\ disk

I specified i want the export file to be named roma.obj

Warning : since this file will contain the whole scene it can be quite big ( example: 30 MB )

Specifying the location of Blender

n the Export section, click on the second "Browse" button,

Specify the location of Blender.exe

On a typical machine, that's C:\Program Files\Blender Foundation\Blender\blender.exe

Adding Environment Lighting

in the "World Environment" section, check-mark the "Use This Color" check-box change the color to

light cyan and the Strength to 0.33

To Blender !

Click on the "Export/Open Current File" button

A few seconds later Blender should open with your scene ready to render

click to enlarge

Click on the Blender's Render/Image button

The result:

Transfering and rendering an animated Daz Studio scene in Blender

Launch mcjTeleBlender

Basic setup

As for the case of the still scene,

- specify the location of the exported files, i will use C:\roma\roma.obj

- specify the location of blender

- add environment lighting

Range of frames to export

In the "Scene-frames to export" section, specify the scene-frames to export

in this example, 30 .obj files will be created in F:\roma

roma0.obj, roma1.obj ... roma29.obj

This duration happens to be the duration of the dancing character's dance move.

warning: keep in mind that this fills up substantial space on your hard disk

Range of frames to render

in the "Export" section, specify the range of frames to render,

since the range of frames to export ( 30 ) is smaller than the range of frames to render ( 150 )

the animation will be looping every 30 frames.

Location of the rendered images

By default, Blender will attempt to save the rendered images in c:\tmp under the names 0000.png, 0001.png ... 0149.png

You can change this in the section titled "Location and type of rendered images"

Export scene-frames and create the render batch file

click on the "Export Animation" button

Each frame ( 30 in our example ) will take a few seconds to export

Rendering the animation

For animations, rendering ( in our case 150 images ) is done through the use of a batch file.

The batch file can be found in the same folder where the .obj files were exported

in our example, here it is, roma.bat in the f:\roma\ folder

Note how our 30 exported .obj files occupy almost half a gigabyte

launch the rendering process by double-left-clicking on the batch file ( roma.bat in this example )

You can follow the progress using the console/window shown below.

Using a batch file to render an animation has the great advantage of allowing you to pause the render using your keyboard's Pause button.

Using and re-using a (.blend) scene file

To save time and disk space, we can create then use and re-use a blender scene file

creating a (.blend) scene file with the help of mcjTeleBlender

as our render engine we specify 'Cycles'

for our sample scene, we hide the dancing character

In the "Export" section, we specify we want the exported .obj to be F:\roma\romaScene.obj

we use the Export/Open current frame button

this opens our (static) scene in Blender

we can add lights, modify the materials, move things around, anything we want !

and we save it as F:\roma\romascene.blend

Using the .blend Scene file

In our Daz Scene, we hide everything except the animated character

In the "Render Engine" section, select "Scene File ( .blend )"

and specify the blender scene file we created in the preceding step

ready to render !

Using and re-using a (.blend) material library

The .obj/.mtl format used to exchange scenes between Daz Studio and Blender

is not completely adapted to the transfer of complex/sophisticated materials.

So mcjTeleBlender gives you the ability use a .blend scene as a library of materials

example:

we have a Daz Studio scene with Numan being carried by your average roboseat

when we export and render it in Blender it looks like this

Now we can tweak the materials until they are acceptable, which, yes indeed, requires reading tutorials like

ones found here http://www.blendercycles.com/

Now we delete everything which is part of the decor file ( romaScene.blend )

and we save this Blender Scene as f:\roma\NumanMaterialLibrary.blend

close Blender.

Back in Daz Studio, in the mcjTeleBlender's "Process Materials" section, select "Use mat-Lib" and browse

up to the .blend material library we created a moment ago, "f:\roma\NumanMaterialLibrary.blend"

Now when we render an animation or a still image, those materials will be used.

The result

Using Blender's Internal renderer

In the "Render Engine" section, select the "Blender Renderer" option

in the "Process Materials" section, select any option except "Cycles Nodes".

Typically, use "Blender Fix"

Following the import of your scene in Blender, the suite of python scripts we supplied will fix the blender materials

If a material uses an opacity map, then the "use alpha" of this material will be set to False. This is because Daz Studio

uses RGB images for its opacity maps , whereas Blender expects to use the Alpha channel of an RGBA image

Unfortunately, so far, the eyebrows of Daz Figures like Aiko 3 don't render properly when Environment lighting is used

unless you turn off the "traceable" option of the material. But for regular lighting they render properly

If a material uses a Reflection map, then the material's "Mirror" option will be turned on, the reflection factor will be set to 1.

If a material has a Ambient map, the material's "Emit" option will be set to ON

The cycles materials

Process Materials : Cycles nodes

Cycles renderer expects node-based materials, the kit of python scripts you installed earlier takes care

of converting the imported materials into node-based materials.

Here's the node tree for a simple material

In Daz Studio, this surface has a full-white Specular Color

If you apply an image map to the Reflection channel of a material in Daz Studio

it will be made reflective in Blender-Cycles

if you apply a texture map to the Diffuse channel of a material in Daz Studio

it will be used in Blender-Cycles

if you apply a map to the Specular channel of a material in Daz Studio

it will be used to modulate the glossiness of the Cycles material in Blender

In the example below a map was used to keep the skin glossy but not the jeans material

If you apply an Opacity/Transparency map to a material in Daz Studio

it will be used to modulate the opacity of a BSDF-Transparent node in Blender

Important note: in the example below,

the cornea is made semi-transparent by the use of a transparency map

without this, the cornea would be opaque

we would not see the iris and pupil.

If you want the cornea to be 100% transparent,

apply a fully black transparency map to it in Daz Studio

added june 26th 2012

texture coordinates / mapping

the Blender script package now contains a script named mcjAddMappersToTexImgs.py

mcjBlendBot.py calls one of its functions, which adds the nodes needed to do texture tiling

added june 26th 2012

another way to re-use custom materials (.blend files )

After importing a scene/file ( .obj ), the mcjBlendBot suite of scripts

will go through the list of materials in the scene.

If a given material makes use of an image file named with the prefix "lib_"

then the script will attempt to import a similarly named material

from a similarly named .blend file.

For example, I created a material and named it lib_cornea

i applied it to a simple plane ( Add / Mesh / Plane )

I saved it under the name lib_cornea.blend in my F:\Roma folder.

In the same folder, i created a black image and named it lib_cornea.jpg.

In Daz Studio i applied this black image as the opacity channel of Aiko's cornea

Now when i render this scene using mcjTeleBlender,

the material lib_cornea located in the file f:\roma\lib_cornea.blend

will be applied to Aiko's cornea

Warning: if by accident the file lib_cornea.blend does not exist

the whole import process may fail.

WARNING : if you are using mcjBlender's "Collect maps" option

then your lib_xxxxx.jpg images will end up in the "Maps" folder

along with the other texture images in the scene.

So mcjBlendBot will not be able to find the corresponding lib_xxxxx.blend file.

So you have 2 choices

1 - not use the "Collect maps option"

2 - not use the copy your lib_xxxxx.blend file to the "Maps" folder

on june 29th 2012 i uploaded a new version of the mcjBlendBot kit of scripts - it doesnt solve this problem but at least it doesnt interrupt the loading of the scene, when the lib_xxxxx.blend files cant be found.

Cycles Render Engine Settings

When the Cycles Renderer is in effect, the default settings are chosen to work on any computer

Feature set: Supported Device: CPU

if your computer is equipped with a modern NVidia graphics card, you'll probably want to use

Feature set: Experimental Device: GPU Device: CUDA

if your computer is equipped with a modern ATI graphics card, you'll probably want to use

Feature set: Experimental Device: GPU Device: OpenCL

the section of Blender's manual about GPU rendering http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/GPU_Rendering

in some tests, GPU rendering was found to be 12 times faster than CPU rendering

though GPU rendering can not support scenes with gigantic textures and geometries

mcjBlendBot.py / Gloss factor and Roughness

in the"mcjBlendBot.py" section, "Gloss Factor" and "Roughness" let you control the default

glossiness of all the cycles materials when "Process Materials/Cycles Nodes" is in effect

Gloss

0.05

Rough

0.20

Gloss

1.00

Rough

0.00

Gloss

1.00

Rough

0.20

Gloss

0.05

Rough

0.00

Export / Use plugin if available

If this option is check-marked, mcjTeleBlender will try to locate the mcjGeoSender plugin

and use it for the .obj export process.

As of this writing, mcjGeoSender, is available for Daz Studio 3, Windows 32/64 bit.

This exporter can be 10 times faster than Daz Studio 3's internal .obj exporter

mcjGeoSender can be found here: https://sites.google.com/site/mcasualsdazscripts/mcjgeosender

Default: ON

Export / Collect Maps

if check-marked, the texture maps files (images) will all be placed in the "Maps" sub-folder

in the same folder where your .obj/.mtl files are located.

Default: OFF

Export / Single .mtl file

this option is only effective if the mcjGeoSender plugin is installed

All the exported .obj file will share the same .mtl file.

Default: ON

Export / Fix .mtl file for Blender

Daz Studio's .obj/.mtl exporter may specify paths to images like this

/Maps/image.jpg

or like this

"c:\folder\image.jpg"

which would cause Blender to refuse to load the scene

When this option is check-marked, mcjTeleblender will modify the .mtl file to make it Blender-compatible

( You may want to un-check this option if the target importer is not Blender )

Default: ON

Export / Export Current Daz Camera

When this option is check-marked, mcjTeleblender will transfer the position,

orientation and focal length of the currently active camera to Blender.

And this means, animated cameras too!

Default: ON

Export / Export lights

Lights with the same color and positions will be created in the Blender scene. ( animated lights too )

all lights will be treated as point-lights

Default: ON

Export / Scale

Daz Studio uses a scaling of 1 unit = 1 cm

Blender uses a scaling of 1 unit = 100 cm ( note for a long time this was erroneously stated as 50cm )

so when Blender is the target importer, we use a scale of 1%

Default: 1

Export / no progress bar

if checked, no progress bar will be displayed during the export of an animation.

This is possibly needed when exporting figures animated using Animate.

The disadvantage is that it prevents you from halting the export process

Default: OFF

World Environment / Texture

If the renderer is Blender-Cycles, this texture will be used an an World - Background - Environment Texture

Otherwise, this texture will be added to the World, the texture will influence "Blend" and "Horizon"

and "Environment Lighting" will be turned on

This gives you Image Based Lighting ( IBL )

Note that there's problems with Blender-Render's "Environment Lighting" and materials with transparencies.

you could solve this by turning the material's "Traceable" option off.but you lose transparency shadows

Default: OFF, Strength=1.0

mcjBlenderBot.py / Gamma Fix

Blender's internal .obj importer lightens up the material colors, this fix darkens them using the equation

color_out = color_in * color_in ( component values in the [0..1] range )

Default: ON

mcjBlenderBot.py / Edge Split

An "Edge Split" modifier will be added to each object in your scene/.obj

This way, object like cubes retain their sharp edges, while characters bodies remain smooth-looking

Default: ON

mcjBlenderBot.py / Set Smooth

The "smooth" option is applied to all the objects in your scene/.obj

Default : ON

For Daz Studio version 1.8 Users

The good news is, you can use mcjTeleblender to export Studio scenes for render in Blender

The moderately bad news is, for each scene/Frame export, you have to click the "OK" button on the export settings panel

To get proper scaling, Select the "Poser" preset, but change the scale to 2%

You only have to do this once.

When things go wrong

Let me illuminate to you the precarious situation i which you have found yourself. I am the one they call when things go wrong, and things have indeed gone wrong. -- Mister Cobra Bubbles in the movie Lilo and Stitch ( http://www.youtube.com/watch?v=kExPEjMMYlg )

missing image textures

Sometimes the .obj/.mtl exporter refers to images that no longer exist on your hard disk.

In a case like that, Blender's obj/mtl importer will refuse to load the .obj/.mtl files.

Or the .mtl file will refer to a file named "example.bmp" as "example.jpg" and therefore

Blender will be unable to locate the image.

In such a case you should check-mark mcjTeleBlender's the "Collect maps" option.

this may be enough to solve the problem

else, inspect the .mtl file to find the problem

Also make sure you are not specifying a non-existing image for World-Environment

running out of memory due to large images / geometries

Sometimes the image files are so numerous and large ( example 4000x4000 pixels ) that they fill

up your graphic card's memory. The cycles renderer will either crash or render a black image

In such a case you should check-mark mcjTeleBlender's the "Collect maps" option.

then go in the /Maps/ folder ( located in the same folder as the .obj/.mtl/.bat/.py files )

and, using a paint program, resize the big ones.

If you are willing to suffer the speed penalty, changing the Cycles Render engine to

"SUPPORTED" / "CPU" may solve the problem

Sometimes the geometry of the objects in the scene is too large ( example: a scene with many characters )

and it doesnt fit on your graphic card's memory.

here too, changing the Cycles Render engine to "SUPPORTED" / "CPU" may solve the problem

invalid paths

depending on the chosen options, there's 6 places where you have to specify paths to files on your hard disk.

make sure they point to valid locations

Wrong version of Blender

This software suite was developped for Blender 2.61, the official release, it may work with Blender 2.5x

but most probably not for versions 2.4x

Appendix 1 - Defaults