forked from LeenkxTeam/LNXSDK
moisesjpelaez - General Fixes
This commit is contained in:
@ -69,7 +69,7 @@ def build():
|
||||
if rpdat.lnx_irradiance:
|
||||
# Plain background color
|
||||
if '_EnvCol' in world.world_defs:
|
||||
world_name = lnx.utils.safestr(world.name)
|
||||
world_name = lnx.utils.safestr(lnx.utils.asset_name(world) if world.library else world.name)
|
||||
# Irradiance json file name
|
||||
world.lnx_envtex_name = world_name
|
||||
world.lnx_envtex_irr_name = world_name
|
||||
@ -99,7 +99,7 @@ def build():
|
||||
def create_world_shaders(world: bpy.types.World):
|
||||
"""Creates fragment and vertex shaders for the given world."""
|
||||
global shader_datas
|
||||
world_name = lnx.utils.safestr(world.name)
|
||||
world_name = lnx.utils.safestr(lnx.utils.asset_name(world) if world.library else world.name)
|
||||
pass_name = 'World_' + world_name
|
||||
|
||||
shader_props = {
|
||||
@ -160,7 +160,7 @@ def create_world_shaders(world: bpy.types.World):
|
||||
|
||||
def build_node_tree(world: bpy.types.World, frag: Shader, vert: Shader, con: ShaderContext):
|
||||
"""Generates the shader code for the given world."""
|
||||
world_name = lnx.utils.safestr(world.name)
|
||||
world_name = lnx.utils.safestr(lnx.utils.asset_name(world) if world.library else world.name)
|
||||
world.world_defs = ''
|
||||
rpdat = lnx.utils.get_rp()
|
||||
wrd = bpy.data.worlds['Lnx']
|
||||
@ -175,7 +175,7 @@ def build_node_tree(world: bpy.types.World, frag: Shader, vert: Shader, con: Sha
|
||||
frag.write('fragColor.rgb = backgroundCol;')
|
||||
return
|
||||
|
||||
parser_state = ParserState(ParserContext.WORLD, world.name, world)
|
||||
parser_state = ParserState(ParserContext.WORLD, lnx.utils.asset_name(world) if world.library else world.name, world)
|
||||
parser_state.con = con
|
||||
parser_state.curshader = frag
|
||||
parser_state.frag = frag
|
||||
|
Reference in New Issue
Block a user