forked from bartvdbraak/blender
Cleanup: format
This commit is contained in:
parent
0652945dbd
commit
6a5ab77dcc
@ -214,7 +214,8 @@ void create_usd_preview_surface_material(const USDExporterContext &usd_export_co
|
||||
/* Set opacityThreshold if an alpha cutout is used. */
|
||||
if (has_opacity) {
|
||||
if ((material->blend_method == MA_BM_CLIP) && (material->alpha_threshold > 0.0)) {
|
||||
pxr::UsdShadeInput opacity_threshold_input = preview_surface.CreateInput(usdtokens::opacityThreshold, pxr::SdfValueTypeNames->Float);
|
||||
pxr::UsdShadeInput opacity_threshold_input = preview_surface.CreateInput(
|
||||
usdtokens::opacityThreshold, pxr::SdfValueTypeNames->Float);
|
||||
opacity_threshold_input.GetAttr().Set(pxr::VtValue(material->alpha_threshold));
|
||||
}
|
||||
}
|
||||
|
@ -144,7 +144,8 @@ class USDExportTest(AbstractUSDTest):
|
||||
shader_prim = stage.GetPrimAtPath("/_materials/Material/Principled_BSDF")
|
||||
shader = UsdShade.Shader(shader_prim)
|
||||
opacity_input = shader.GetInput('opacity')
|
||||
self.assertEqual(opacity_input.HasConnectedSource(), False, "Opacity input should not be connected for opaque material")
|
||||
self.assertEqual(opacity_input.HasConnectedSource(), False,
|
||||
"Opacity input should not be connected for opaque material")
|
||||
self.assertAlmostEqual(opacity_input.Get(), 1.0, "Opacity input should be set to 1")
|
||||
|
||||
# The material already has a texture input to the Base Color.
|
||||
@ -174,7 +175,6 @@ class USDExportTest(AbstractUSDTest):
|
||||
self.assertEqual(opacity_input.HasConnectedSource(), True, "Alpha input should be connected")
|
||||
self.assertGreater(opacity_thres_input.Get(), 0.0, "Opacity threshold input should be > 0")
|
||||
|
||||
|
||||
# Modify material again, this time with alpha blend.
|
||||
bpy.data.materials['Material'].blend_method = 'BLEND'
|
||||
export_path = self.tempdir / "alphablend_material.usda"
|
||||
@ -194,6 +194,7 @@ class USDExportTest(AbstractUSDTest):
|
||||
self.assertEqual(opacity_input.HasConnectedSource(), True, "Alpha input should be connected")
|
||||
self.assertEqual(opacity_thres_input.Get(), None, "Opacity threshold should not be specified for alpha blend")
|
||||
|
||||
|
||||
def main():
|
||||
global args
|
||||
import argparse
|
||||
|
Loading…
Reference in New Issue
Block a user