I have a question, it’s possible with render pipeline, to load a egg object and force to apply anythink of material ?
for example, i want to load the box.egg and apply a rock texture et i want a rock material render (or snow, or gold, or metal…)
this is my code:
from __future__ import print_function
import os
import sys
from panda3d.core import Vec3, load_prc_file_data
from direct.showbase.ShowBase import ShowBase
# Change to the current directory
os.chdir(os.path.dirname(os.path.realpath(__file__)))
# Insert the pipeline path to the system path, this is required to be
# able to import the pipeline classes
pipeline_path = "./RenderPipeline/"
# Just a special case for my development setup, so I don't accidentally
# commit a wrong path. You can remove this in your own programs.
if not os.path.isfile(os.path.join(pipeline_path, "setup.py")):
pipeline_path = "./RenderPipeline/"
sys.path.insert(0, pipeline_path)
from rpcore import RenderPipeline
from rpcore.util.movement_controller import MovementController
class Application(ShowBase):
def __init__(self):
# Setup window size and title
load_prc_file_data("", """
# win-size 1600 900
window-title Render Pipeline - Material Sample
""")
# Construct the render pipeline
self.render_pipeline = RenderPipeline()
self.render_pipeline.create(self)
self.render_pipeline.daytime_mgr.time = "19:17"
cube = self.loader.load_model("box.egg")
cube.reparent_to(self.render)
self.render_pipeline.prepare_scene(cube)
stone_texture = self.loader.loadTexture("stone.jpg")
cube.set_texture(stone_texture, 1)
cube.set_shader_input("albedo_tex", stone_texture)
self.controller = MovementController(self)
self.controller.set_initial_position_hpr(
Vec3(-17.2912578583, -13.290019989, 6.88211250305),
Vec3(-39.7285499573, -14.6770210266, 0.0))
self.controller.setup()
Application().run()
the box is black, i not see the texture and not the render.
the examples given in render piepline, the render and textures are configured in blender in the bam file, I would like to know if it can be done in python code instead.