diff --git a/soho/python2.7/PBRTnodes.py b/soho/python2.7/PBRTnodes.py index d0a6a9b..9f2d768 100644 --- a/soho/python2.7/PBRTnodes.py +++ b/soho/python2.7/PBRTnodes.py @@ -382,7 +382,9 @@ def get_used_parms(self): if self.node.coshaderNodes(parm_name): # Instead of adding checks for this multiple # times, check once and then continue - parms[parm_name] = parm_tup + if not parm_tup.isHidden(): + # If hidden, then wrong signature + parms[parm_name] = parm_tup continue if parm_tup.isDisabled() or parm_tup.isHidden(): diff --git a/soho/python3.7/PBRTnodes.py b/soho/python3.7/PBRTnodes.py index 8c61db5..1bf5bb4 100644 --- a/soho/python3.7/PBRTnodes.py +++ b/soho/python3.7/PBRTnodes.py @@ -380,7 +380,9 @@ def get_used_parms(self): if self.node.coshaderNodes(parm_name): # Instead of adding checks for this multiple # times, check once and then continue - parms[parm_name] = parm_tup + if not parm_tup.isHidden(): + # If hidden, then wrong signature + parms[parm_name] = parm_tup continue if parm_tup.isDisabled() or parm_tup.isHidden(): diff --git a/tests/scenes/TestMaterials/test_texture_mixing_material.pbrt b/tests/scenes/TestMaterials/test_texture_mixing_material.pbrt new file mode 100644 index 0000000..1d391d6 --- /dev/null +++ b/tests/scenes/TestMaterials/test_texture_mixing_material.pbrt @@ -0,0 +1,52 @@ + +Film "rgb" "string filename" [ "test_texture_mixing_material.exr" ] "integer xresolution" [ 320 ] "integer yresolution" [ 240 ] +PixelFilter "gaussian" "float xradius" [ 2 ] "float yradius" [ 2 ] +Sampler "zsobol" "integer pixelsamples" [ 16 ] +Integrator "volpath" "integer maxdepth" [ 5 ] +Accelerator "bvh" + +# /obj/cam1 +Transform [ 0.6691 -0.4263 -0.6087 0 0 0.8192 -0.5736 0 -0.7431 -0.3838 -0.5481 0 0.5921 -0.07283 13.84 1 ] +Camera "perspective" "float fov" [ 45 ] "float screenwindow" [ -1 1 -0.75 0.75 ] + +WorldBegin # { + + # ================================================== + # Light Definitions + # /obj/envlight1 + AttributeBegin # { + Transform [ 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 ] + Scale 1 1 -1 + Rotate 90 0 0 1 + Rotate 90 0 1 0 + LightSource "infinite" "float scale" [ 0.5 ] + AttributeEnd # } + + + # ================================================== + # NamedMaterial Definitions + Texture "/mat/pbrt_texture_checkerboard2" "spectrum" "checkerboard" + Texture "/mat/pbrt_texture_checkerboard1" "float" "checkerboard" + Texture "/mat/pbrt_texture_mix1" "float" "mix" "float amount" [ 0.4 ] "texture tex1" [ "/mat/pbrt_texture_checkerboard1" ] + Texture "/mat/pbrt_texture_mix2" "spectrum" "mix" "texture amount" [ "/mat/pbrt_texture_mix1" ] "texture tex1" [ "/mat/pbrt_texture_checkerboard2" ] + MakeNamedMaterial "/mat/pbrt_material_diffuse1" "string type" "diffuse" "texture reflectance" [ "/mat/pbrt_texture_mix2" ] + + + # ================================================== + # NamedMedium Definitions + + # ================================================== + # Object Instance Definitions + + # ================================================== + # Object Definitions + # -------------------------------------------------- + # /obj/geo1 + AttributeBegin # { + ConcatTransform [ 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 ] + NamedMaterial "/mat/pbrt_material_diffuse1" + # Can not find soppath for object + AttributeEnd # } + + + # } diff --git a/tests/tests.py b/tests/tests.py index 72f1e41..c6532c9 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -929,7 +929,7 @@ def test_exterior_cam(self): def test_exterior_cam_interior_obj(self): # TODO / NOTE: - # I don't believe this test is givign the expected results + # I don't believe this test is giving the expected results # as there is no mediums attached to the lights. # This is a lack of understanding on how pbrt-v4 works and # will require some experiments @@ -1048,6 +1048,30 @@ def test_checker_material(self): self.geo.parm("shop_materialpath").set(matte.path()) self.compare_scene() + def test_texture_mixing_material(self): + space = hou.node("/obj").createNode("null") + space.parmTuple("t").set([1, 2, 3]) + space.parmTuple("s").set([5, 10, 20]) + matte = hou.node("/mat").createNode("pbrt_material_diffuse") + checks_float = hou.node("/mat").createNode("pbrt_texture_checkerboard") + checks_spectrum = hou.node("/mat").createNode("pbrt_texture_checkerboard") + mix_float = hou.node("/mat").createNode("pbrt_texture_mix") + mix_spectrum = hou.node("/mat").createNode("pbrt_texture_mix") + checks_float.parm("signature").set("default") + checks_float.parm("dimension").set(2) + mix_float.parm("signature").set("default") + mix_float.parm("amount").set(0.4) + checks_spectrum.parm("signature").set("s") + checks_spectrum.parm("dimension").set(2) + mix_spectrum.parm("signature").set("s") + mix_spectrum.parm("amount").set(0.4) + mix_float.setNamedInput("tex1", checks_float, "output") + mix_spectrum.setNamedInput("tex1", checks_spectrum, "output") + mix_spectrum.setNamedInput("amount", mix_float, "output") + matte.setNamedInput("reflectance", mix_spectrum, "output") + self.geo.parm("shop_materialpath").set(matte.path()) + self.compare_scene() + class TestSpectrum(TestRoot): @classmethod