We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

How to change emission color in verge3d?

Home Forums Programming How to change emission color in verge3d?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #33795
    derekwang0605
    Customer

    Hi,
    I have Verge3DCamMat material in Blender which did not use Principled BSDF.
    mat = bpy.data.materials.new(‘Verge3DCamMat’)
    mat.use_nodes = True
    bsdf = mat.node_tree.nodes[“Principled BSDF”]
    mat.node_tree.nodes.remove(bsdf)
    matOutput= mat.node_tree.nodes[“Material Output”]
    matOutput.location=(600,0)

    mixShader = mat.node_tree.nodes.new(‘ShaderNodeMixShader’)
    mixShader.location=(400,0)

    diffuseBSDF = mat.node_tree.nodes.new(‘ShaderNodeBsdfDiffuse’)
    diffuseBSDF.location=(200,0)
    diffuseBSDF.inputs[‘Color’].default_value=(1,1,1,1)

    emission = mat.node_tree.nodes.new(‘ShaderNodeEmission’)
    emission.location=(200,-200)
    emission.inputs[‘Color’].default_value=emissioncolor

    lightPath = mat.node_tree.nodes.new(‘ShaderNodeLightPath’)
    lightPath.location=(0,300)

    #link
    mat.node_tree.links.new(mixShader.outputs[0], matOutput.inputs[0])
    mat.node_tree.links.new(lightPath.outputs[0], mixShader.inputs[0])
    mat.node_tree.links.new(diffuseBSDF.outputs[0], mixShader.inputs[1])
    mat.node_tree.links.new(emission.outputs[0], mixShader.inputs[2])
    How to change emission color in Verge3D? And also how to list the nodes in Verge3D?
    var mats = v3d.SceneUtils.getMaterialsByName(app,’Verge3DCamMat’);
    mats[’emission’]=(0.5,0.5,0.5)
    But it did not work.

    #33802
    GLiFTeK
    Customer

    You’d use a change color puzzle from the materials section to change an rgb color node that you plug into the emission node’s color input.

    Change value puzzle will work as well.

    #33804
    derekwang0605
    Customer

    Thanks! I tried by your way as I did not use principled BSDF so set color has <no colors> option.

    #33806
    GLiFTeK
    Customer

    Thanks! I tried by your way as I did not use principled BSDF so set color has <no colors> option.

    Well like I said, you have to use another RGB Color node plugged into the emission channel input plug in the PBR, then THAT one will show up in the Verge puzzle.

    Also, if you need a numerical value for alpha or a Fac, you would plug in a “Value” node into them, and name it accordingly in the side panel, then choose that name in the value puzzle.

    #33807
    derekwang0605
    Customer

    Thanks a lot! It works well. :good: :good:

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.