How to process models while using tobspr's RP?

Just like the title.
I have checked the Wiki in tobspr’s RP project( Exporting from Blender · tobspr/RenderPipeline Wiki (github.com)).
But I just find that the “BAM Exporter” mentioned in the page above is not support animations.
Besides,the “Material” mentioned in the page above is empty.
So can we use YABEE or Maya2egg or Blend2bam to export models and use it in RP?
And…How to export an egg without any material,then add material(like normal map,roughness texture and etc.) to it by writing code?Any code demo please?

You can study the models supplied with RP.

For example, the getMaterial() method will give you information about the parameters. You can use YABEE with the flag:

https://discourse.panda3d.org/uploads/default/optimized/1X/568e3b4242137491e59f52b73cbe7870164d8954_2_519x499.png

However, you will be limited to the blender version. 2. 7

Thanks for your reply.
I think it is hard for us to study the models supplied with RP.
Because we do not know which blender version the author use and we can not analyze what options were made in blender one by one.
So how to make pbr material so that YABEE can export it with “extra pbs” option?
In other words,are there any rules need to obey?
I have checked the manual in YABEE’s page.
But it seems that it is not clearly described.
So any tutorial please?
And…Could you please tell me if we can export an egg without any material by Maya2egg or Blend2bam,then add material(like normal map,roughness texture and other textures relavent to pbr) to it by writing code?

Yes, you can write code to create RP materials. However, I repeat, you need to study the models again. And these sections:

Manual

https://docs.panda3d.org/1.10/python/programming/texturing/index
https://docs.panda3d.org/1.10/python/programming/render-attributes/materials

API

https://docs.panda3d.org/1.10/python/reference/panda3d.core.Texture
https://docs.panda3d.org/1.10/python/reference/panda3d.core.TextureStage
https://docs.panda3d.org/1.10/python/reference/panda3d.core.Material

This way you can find out the initial parameters of the models that come with RP. Please note that the order of the stages for textures is important.

from direct.showbase.ShowBase import ShowBase
from panda3d.core import MaterialAttrib, TextureAttrib

class App(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)

        scene = loader.load_model("Scene.bam")

        for node_path in scene.find_all_matches('**/+GeomNode'):
            geom_states = node_path.node().get_geom_states()
            print(node_path.name)
            for geom_state in geom_states:
                if geom_state.has_attrib(MaterialAttrib):
                    print(geom_state.get_attrib(MaterialAttrib).get_material())

                if geom_state.has_attrib(TextureAttrib):
                    texture_stages = geom_state.get_attrib(TextureAttrib).get_on_stages()
                    for texture_stage in texture_stages:
                        print(texture_stage, geom_state.get_attrib(TextureAttrib).get_on_texture(texture_stage))

                print("------------------------")
app = App()
app.run()

out:

2.003
Material
  base_color = 0.195987 0.195987 0.195987 1
  refractive_index = 1.38467
  emission = 0 0 0 0
  roughness = 0.629749
  metallic = 0
  local = 0
  twoside = 0

TextureStage empty_basecolor-0, sort = 0, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_basecolor.png (from /d/Code/RenderPipeline/test/scene/tex/empty_basecolor.png)
  2-d, 2 x 2 pixels, each 3 bytes, srgb
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  12 bytes in ram, compression off

TextureStage empty_normal-10, sort = 10, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_normal.png (from /d/Code/RenderPipeline/test/scene/tex/empty_normal.png)
  2-d, 2 x 2 pixels, each 4 bytes, rgba
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  16 bytes in ram, compression off

TextureStage empty_specular-20, sort = 20, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_specular.png (from /d/Code/RenderPipeline/test/scene/tex/empty_specular.png)
  2-d, 2 x 2 pixels, each 4 bytes, rgba
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  16 bytes in ram, compression off

TextureStage empty_roughness-30, sort = 30, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_roughness.png (from /d/Code/RenderPipeline/test/scene/tex/empty_roughness.png)
  2-d, 2 x 2 pixels, each 3 bytes, rgb
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  12 bytes in ram, compression off

------------------------
1.002
Material
  base_color = 1 1 1 1
  refractive_index = 1.5
  emission = 0 0 0 0
  roughness = 0.3
  metallic = 0
  local = 0
  twoside = 0

TextureStage BackDiff-0, sort = 0, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture pattern.png (from /d/Code/RenderPipeline/test/scene/tex/pattern.png)
  2-d, 128 x 128 pixels, each 4 bytes, srgb_alpha
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  65536 bytes in ram, compression off

TextureStage empty_normal-10, sort = 10, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_normal.png (from /d/Code/RenderPipeline/test/scene/tex/empty_normal.png)
  2-d, 2 x 2 pixels, each 4 bytes, rgba
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  16 bytes in ram, compression off

TextureStage empty_specular-20, sort = 20, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_specular.png (from /d/Code/RenderPipeline/test/scene/tex/empty_specular.png)
  2-d, 2 x 2 pixels, each 4 bytes, rgba
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  16 bytes in ram, compression off

TextureStage empty_roughness-30, sort = 30, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_roughness.png (from /d/Code/RenderPipeline/test/scene/tex/empty_roughness.png)
  2-d, 2 x 2 pixels, each 3 bytes, rgb
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  12 bytes in ram, compression off

------------------------
3.003
Material
  base_color = 0.486 0.631 0.663 1
  refractive_index = 1.40974
  emission = 0 0 0 0
  roughness = 0.0544803
  metallic = 0
  local = 0
  twoside = 0

TextureStage empty_basecolor-0, sort = 0, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_basecolor.png (from /d/Code/RenderPipeline/test/scene/tex/empty_basecolor.png)
  2-d, 2 x 2 pixels, each 3 bytes, srgb
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  12 bytes in ram, compression off

TextureStage empty_normal-10, sort = 10, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_normal.png (from /d/Code/RenderPipeline/test/scene/tex/empty_normal.png)
  2-d, 2 x 2 pixels, each 4 bytes, rgba
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  16 bytes in ram, compression off

TextureStage empty_specular-20, sort = 20, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_specular.png (from /d/Code/RenderPipeline/test/scene/tex/empty_specular.png)
  2-d, 2 x 2 pixels, each 4 bytes, rgba
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  16 bytes in ram, compression off

TextureStage empty_roughness-30, sort = 30, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_roughness.png (from /d/Code/RenderPipeline/test/scene/tex/empty_roughness.png)
  2-d, 2 x 2 pixels, each 3 bytes, rgb
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  12 bytes in ram, compression off

------------------------
3.002
Material
  base_color = 0.486 0.631 0.663 1
  refractive_index = 1.40974
  emission = 0 0 0 0
  roughness = 0.0544803
  metallic = 0
  local = 0
  twoside = 0

TextureStage empty_basecolor-0, sort = 0, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_basecolor.png (from /d/Code/RenderPipeline/test/scene/tex/empty_basecolor.png)
  2-d, 2 x 2 pixels, each 3 bytes, srgb
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  12 bytes in ram, compression off

TextureStage empty_normal-10, sort = 10, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_normal.png (from /d/Code/RenderPipeline/test/scene/tex/empty_normal.png)
  2-d, 2 x 2 pixels, each 4 bytes, rgba
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  16 bytes in ram, compression off

TextureStage empty_specular-20, sort = 20, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_specular.png (from /d/Code/RenderPipeline/test/scene/tex/empty_specular.png)
  2-d, 2 x 2 pixels, each 4 bytes, rgba
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  16 bytes in ram, compression off

TextureStage empty_roughness-30, sort = 30, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_roughness.png (from /d/Code/RenderPipeline/test/scene/tex/empty_roughness.png)
  2-d, 2 x 2 pixels, each 3 bytes, rgb
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  12 bytes in ram, compression off

------------------------
1.001
Material
  base_color = 1 1 1 1
  refractive_index = 1.5
  emission = 0 0 0 0
  roughness = 0.3
  metallic = 0
  local = 0
  twoside = 0

TextureStage BackDiff-0, sort = 0, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture pattern.png (from /d/Code/RenderPipeline/test/scene/tex/pattern.png)
  2-d, 128 x 128 pixels, each 4 bytes, srgb_alpha
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  65536 bytes in ram, compression off

TextureStage empty_normal-10, sort = 10, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_normal.png (from /d/Code/RenderPipeline/test/scene/tex/empty_normal.png)
  2-d, 2 x 2 pixels, each 4 bytes, rgba
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  16 bytes in ram, compression off

TextureStage empty_specular-20, sort = 20, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_specular.png (from /d/Code/RenderPipeline/test/scene/tex/empty_specular.png)
  2-d, 2 x 2 pixels, each 4 bytes, rgba
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  16 bytes in ram, compression off

TextureStage empty_roughness-30, sort = 30, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_roughness.png (from /d/Code/RenderPipeline/test/scene/tex/empty_roughness.png)
  2-d, 2 x 2 pixels, each 3 bytes, rgb
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  12 bytes in ram, compression off

------------------------
2.002
Material
  base_color = 0.195987 0.195987 0.195987 1
  refractive_index = 1.38467
  emission = 0 0 0 0
  roughness = 0.629749
  metallic = 0
  local = 0
  twoside = 0

TextureStage empty_basecolor-0, sort = 0, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_basecolor.png (from /d/Code/RenderPipeline/test/scene/tex/empty_basecolor.png)
  2-d, 2 x 2 pixels, each 3 bytes, srgb
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  12 bytes in ram, compression off

TextureStage empty_normal-10, sort = 10, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_normal.png (from /d/Code/RenderPipeline/test/scene/tex/empty_normal.png)
  2-d, 2 x 2 pixels, each 4 bytes, rgba
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  16 bytes in ram, compression off

TextureStage empty_specular-20, sort = 20, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_specular.png (from /d/Code/RenderPipeline/test/scene/tex/empty_specular.png)
  2-d, 2 x 2 pixels, each 4 bytes, rgba
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  16 bytes in ram, compression off

TextureStage empty_roughness-30, sort = 30, priority = 0
  texcoords = texcoord, mode = modulate, color = 1 1 1 1, scale = 1, 1, saved_result = 0, tex_view_offset = 0
 2d_texture empty_roughness.png (from /d/Code/RenderPipeline/test/scene/tex/empty_roughness.png)
  2-d, 2 x 2 pixels, each 3 bytes, rgb
  sampler wrap(u=repeat, v=repeat, w=repeat, border=0 0 0 1) filter(min=linear_mipmap_linear, mag=linear, aniso=16) lod(min=-1000, max=1000, bias=0)  12 bytes in ram, compression off
...

Thanks.
I thought it will be as simple as we use panda3d’s default render.
But I have to say,It is RATHER DIFFICULT!
I think we’d better leave it to blender or other modeling soft instead of writing code.

I want to use YABEE,but it is too old and lack of tutorials.
So can Blend2bam or Panda3d-gltf or PRPEE export models with animations and materials to RenderPipeline correctly?

Don’t use PRPEE, please–I’ve seen so many threads in which people have trouble with exported models, only to reveal that they were using PRPEE.

In short–and presuming admittedly that nothing has changed since last I heard–my understanding is that PRPEE has the features and behaviour appropriate to its developer’s purposes, but isn’t reliable for general usage.

This I can’t speak to, I’m afraid. I would be surprised it blend2bam didn’t do it, however. (Provided an appropriately-made Blender-model, of course.)

1 Like

The stumbling block of RP is four+ given textures in a certain order.

As you know, the blender got rid of the use of texture slots. Now the principle BSDF node is used, where there are named fixed map slots. Which does not allow you to create 1+ textures with the modulate mode(base color).

Theoretically, you can write a converter in a couple of hours that will create the desired texture order from any output file, for example .glTF

3 Likes

I am a noob…I really can not write the plugins you said.Especially there is no any tutorial.

I am going to try this.And I will share give feedback here.

1 Like