0
$\begingroup$

I am trying to render DAZ assets in Blender using Cycles. I am relatively new to both DAZ and Blender. I am able to import a DAZ OBJ file to Blender and see the materials using Blender Internal but not Cycles. My understanding is that the mcjteleblender3 script was specifically written to solve this issue. It builds a default Cycles shader network for each original DAZ material on the object. The script is located here https://sites.google.com/site/mcasualsdazscripts4/mcjteleblender3 but I am unsure how to contact the author or if it is even still maintained.

The export part of the script works fine in DAZ (4.9 64bit Windows). However, the import part of the script fails in Blender (2.78b 64bit Windows). I'm not sure where it fails, but "import mcjBlendBot" does not return an error, so it likely has found the main library. The pull-down python panel at the top of the Blender window shows only these lines:

bpy.context.area.type = 'TEXT_EDITOR'
bpy.ops.text.run_script()
Python script fail, look in the console for now...  [shown in red]

The system console, after I manually import the exported OBJ, shows the following information:

Read new prefs: C:\Users\dle\AppData\Roaming\Blender Foundation\Blender\2.78\config\userpref.blend
found bundled python: C:\Program Files\Blender Foundation\Blender\2.78\python
(  0.0005 sec |   0.0005 sec) Importing OBJ 'C:\\Users\\dle\\Documents\\Projects\\Art\\DAZ\\DAZ_output\\script\\woman_sitting_script_export.obj'...
  (  0.0010 sec |   0.0000 sec) Parsing OBJ file...
    (  2.4978 sec |   2.4968 sec) Done, loading materials and images...
        'C:\\Users\\dle\\Documents\\Projects\\Art\\DAZ\\DAZ_output\\script\\woman_sitting_script_export.obj':b'Km 0.1' (ignored)
        'C:\\Users\\dle\\Documents\\Projects\\Art\\DAZ\\DAZ_output\\script\\woman_sitting_script_export.obj':b'Km 0.1' (ignored)
        'C:\\Users\\dle\\Documents\\Projects\\Art\\DAZ\\DAZ_output\\script\\woman_sitting_script_export.obj':b'Km 0.1' (ignored)
        'C:\\Users\\dle\\Documents\\Projects\\Art\\DAZ\\DAZ_output\\script\\woman_sitting_script_export.obj':b'Km 0.1' (ignored)
        'C:\\Users\\dle\\Documents\\Projects\\Art\\DAZ\\DAZ_output\\script\\woman_sitting_script_export.obj':b'Km 0.1' (ignored)
    (  2.5204 sec |   2.5194 sec) Done, building geometries (verts:136949 faces:126728 materials: 28 smoothgroups:0) ...
    (  4.9410 sec |   4.9401 sec) Done.
  (  4.9420 sec |   4.9410 sec) Finished importing: 'C:\\Users\\dle\\Documents\\Projects\\Art\\DAZ\\DAZ_output\\script\\woman_sitting_script_export.obj'
Progress: 100.00%

Traceback (most recent call last):
  File "\woman_sitting_script_export.py", line 41, in <module>
AttributeError: module 'mcjBlendBot' has no attribute 'setRenderEngine'
Error: Python script fail, look in the console for now...

The script, which I opened and ran from the Blender text editor is below. I would appreciate any advice on how to get the script to run correctly or, alternatively, how to import and render DAZ assets in Blender using Cycles.

Thank you,

-d. vyd

import mcjBlendBot
def setBumpMapStrength2( filename, nodeName, matName, strength ):
    if 'setBumpMapStrength2' in dir( mcjBlendBot ):
        mcjBlendBot.setBumpMapStrength2( filename, nodeName, matName, strength )
def setMatGloss2( nodeName, matName, image, rough, r, g, b, strength ):
    if 'setMatGloss2' in dir( mcjBlendBot ):
        mcjBlendBot.setMatGloss2( nodeName, matName, image, rough, r, g, b, strength )
def setMatGloss( nodeName, matName, image, rough, strength ):
    if 'setMatGloss' in dir( mcjBlendBot ):
        mcjBlendBot.setMatGloss( nodeName, matName, image, rough, strength )
def setMatAmbient( nodeName, matName, strength ):
    if 'setMatAmbient' in dir( mcjBlendBot ):
        mcjBlendBot.setMatAmbient( nodeName, matName, strength )
def setNormalMap( nodeName, matName, image, strength ):
    if 'setNormalMap' in dir( mcjBlendBot ):
        mcjBlendBot.setNormalMap( nodeName, matName, image, strength )
def setGlossMix( bGlossMix ):
    if 'setGlossMix' in dir( mcjBlendBot ):
        mcjBlendBot.setGlossMix( bGlossMix )
def setTreeType( iTreeType ):
    if 'setTreeType' in dir( mcjBlendBot ):
        mcjBlendBot.setTreeType( iTreeType )
def addLightV2( name, x, y, z, rx, ry, rz, intensity, r, g, b, lamptype, coneAngle, softness ):
    if 'addLightV2' in dir( mcjBlendBot ):
        mcjBlendBot.addLightV2( name, x, y, z, rx, ry, rz, intensity, r, g, b, lamptype, coneAngle, softness )
def addAreaLight( name, x, y, z, rx, ry, rz, intensity, r, g, b, areaSizeX, areaSizeY  ):
    if 'addAreaLight' in dir( mcjBlendBot ):
        mcjBlendBot.addAreaLight( name, x, y, z, rx, ry, rz, intensity, r, g, b, areaSizeX, areaSizeY  )
def setCyclesProgressive( bOnOff ):
    if 'setCyclesProgressive' in dir( mcjBlendBot ):
        mcjBlendBot.setCyclesProgressive( bOnOff )
def addCamera2( x, y, z, rx, ry, rz, fl, bMakeCur, name ):
    if 'addCamera2' in dir( mcjBlendBot ):
        mcjBlendBot.addCamera2( x, y, z, rx, ry, rz, fl, bMakeCur, name )
def setCyclesTileSize( w, h ):
    if 'setCyclesTileSize' in dir( mcjBlendBot ):
        mcjBlendBot.setCyclesTileSize( w, h )
def setDefMatGlossyTypeBeckman( bOnOff ):
    if 'setDefMatGlossyTypeBeckman' in dir( mcjBlendBot ):
        mcjBlendBot.setDefMatGlossyTypeBeckman( bOnOff )
mcjBlendBot.setRenderEngine( "CYCLES" )
mcjBlendBot.setImageSize( 1002, 915 )
mcjBlendBot.setGloss( 0.025, 0.3 )
mcjBlendBot.setSmooth( True )
mcjBlendBot.setEdgeSplit( True )
setGlossMix( False )
mcjBlendBot.setOutLocAndType( "C:/tmp/images", "JPEG" )
mcjBlendBot.loadfix( "C:/Users/dle/Documents/Projects/Art/DAZ/DAZ_output/script/woman_sitting_script_export.obj", "CYCLESMATS", "C:/Users/dle/Documents/Projects/Art/DAZ/DAZ_output/script/matLib.blend", False )
$\endgroup$
  • $\begingroup$ The error says "look in the console". What did you see when you looked in blender's system console? $\endgroup$ – Ray Mairlot Feb 17 '17 at 16:01
  • $\begingroup$ I was looking in the wrong window. I've edited my question to include the system console output. $\endgroup$ – D. Vyd Feb 18 '17 at 21:30
0
$\begingroup$

As the error suggests, your problem is in line 41 mcjBlendBot.setRenderEngine( "CYCLES" ) try going to the console and type import mcjBlendBot then mcjBlendBot. then ctrl+space bar to see the list of commands you can use.

$\endgroup$
  • $\begingroup$ When I open a Python console in Blender and type "import mcjBlendBot" the file is imported. However, typing "mcjBlendBot." and ctrl+spacebar does nothing. I do not see a list of commands I can use. I don't know why autocompletion does not work. Opening mcBlendBot.py, I found the following lines of code: def setRenderEngine( engine ): if( engine != "AS_IS" ): bpy.context.scene.render.engine = engine so I'm not sure why I get the error module 'mcjBlendBot' has no attribute 'setRenderEngine' $\endgroup$ – D. Vyd Feb 23 '17 at 0:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.