1
$\begingroup$

So, I want to make my text glows. Using python. Until now, I've scripted this, after reading some tutorials:

import bpy
def create():
    bpy.ops.object.text_add(location=(0, 0, 0))
    text_obj = bpy.context.object
    #'glow'
    scene = bpy.context.scene
    scene.world.light_settings.use_indirect_light = True
    scene.world.light_settings.gather_method = 'APPROXIMATE'
    scene.world.light_settings.passes = 2

    mat = makeMaterial("font", (1,1,1), 1.8)
    text_obj.active_material = mat

def makeMaterial(name, color, emit):
    mat = bpy.data.materials.new(name)
    mat.diffuse_color = color
    mat.diffuse_shader = 'LAMBERT' 
    mat.diffuse_intensity = 1.0 
    mat.specular_color = color
    mat.specular_shader = 'COOKTORR'
    mat.specular_intensity = 0
    mat.use_transparency = True
    #mat.raytrace_transparency.fresnel = 2
    #mat.alpha = transp
    mat.emit = emit
    return mat

if __name__ == "__main__":
    create()

Why this isn't working good?

Tks

$\endgroup$
3
  • 1
    $\begingroup$ this script is for blender internal and you should : - add import bpy - fix the return mat identation - add a call at the end create() and it should work $\endgroup$
    – Chebhou
    Commented Jul 22, 2015 at 8:57
  • $\begingroup$ Srry, I've edited. I'm using this already... I think the error is in part of code I've wrote, so I don't put this other part :) $\endgroup$
    – CuriousElf
    Commented Jul 24, 2015 at 13:57
  • $\begingroup$ if you mean that the text is not emit enough light then this is not a script problem but a material setting that you should figure out from the UI then you can attempt to set them up through python ( this script creates a text object and give it an emission mat ) $\endgroup$
    – Chebhou
    Commented Jul 24, 2015 at 14:56

1 Answer 1

3
$\begingroup$

The way you setup the scene, the glow is only noticeable if you have another object. It will not cause the 'air' around the text to glow.

Below is my test render when I run your script with a plane. I this what you want?

enter image description here

If you want the air around the text to glow, approximate ambient occlusion cannot give you that. You'll need to use the compositor.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .