def filterCamera(self): """Apply camera properties. :return: """ set_property("render:tilecallback", self.tilecallback)
def filter_material(self): """Modify material properties. :return: """ if self.disable_displacement: set_property("object:displace", [])
def filterMaterial(self): """Modify material properties. :return: """ if self.disable_displacement: set_property("object:displace", [])
def test(self, mock_prep): mock_name = MagicMock(spec=str) mock_value = MagicMock(spec=int) prop.set_property(mock_name, mock_value) mock_prep.assert_called_with(mock_value) self.mock_mantra.setproperty.assert_called_with( mock_name, mock_prep.return_value)
def filterPlane(self): """Modify aov properties. :return: """ # We can't disable the main image plane or Mantra won't render. if self.disable_aovs and get_property("plane:variable") != "Cf+Af": set_property("plane:disable", 1)
def filter_plane(self): """Modify aov properties. :return: """ # We can't disable the main image plane or Mantra won't render. if self.disable_aovs and get_property("plane:variable") != "Cf+Af": set_property("plane:disable", 1)
def filterCamera(self): """Apply camera properties. :return: """ if self.disable_primary_image: logger.info("Disabling primary image") set_property("image:filename", "null:") elif self.primary_image_path is not None: set_property("image:filename", self.primary_image_path)
def test_set_property(mocker, patch_soho): """Test ht.pyfilter.property.set_property.""" mock_prep = mocker.patch("ht.pyfilter.property._prep_value_to_set") mock_name = mocker.MagicMock(spec=str) mock_value = mocker.MagicMock(spec=int) prop.set_property(mock_name, mock_value) mock_prep.assert_called_with(mock_value) patch_soho.mantra.setproperty.assert_called_with(mock_name, mock_prep.return_value)
def filter_camera(self): """Apply camera properties. :return: """ render_type = get_property("renderer:rendertype") if not self.all_passes and render_type != "beauty": _logger.warning("Not a beauty render, skipping deepresolver") return if self.disable_deep_image: _logger.info("Disabling deep resolver") set_property("image:deepresolver", []) else: # Look for existing args. deep_args = get_property("image:deepresolver") # If deep rendering is not enabled the args will be empty. if not deep_args: # If a resolver type and filename was passed then we will create # args for the resolver type to enable deep output. if self.resolver and self.filename: deep_args = [self.resolver] # Log an error and abort. else: _logger.error( "Cannot set deepresolver: deep output is not enabled") return # Modify the args to include any passed along options. self._modify_deep_args(deep_args) _logger.debug( "Setting 'image:deepresolver': %s", " ".join([str(arg) for arg in deep_args]), ) set_property("image:deepresolver", deep_args)
def filterCamera(self): """Apply camera properties. :return: """ render_type = get_property("renderer:rendertype") if not self.all_passes and render_type != "beauty": logger.warning("Not a beauty render, skipping deepresolver") return if self.disable_deep_image: logger.info("Disabling deep resolver") set_property("image:deepresolver", []) else: # Look for existing args. deep_args = get_property("image:deepresolver") # If deep rendering is not enabled the args will be empty. if not deep_args: # If a resolver type and filename was passed then we will create # args for the resolver type to enable deep output. if self.resolver and self.filename: deep_args = [self.resolver] # Log an error and abort. else: logger.error("Cannot set deepresolver: deep output is not enabled") return # Modify the args to include any passed along options. self._modify_deep_args(deep_args) logger.debug( "Setting 'image:deepresolver': {}".format(" ".join([str(arg) for arg in deep_args])) ) set_property("image:deepresolver", deep_args)
def set_property(self): """Set the property to the value. :return: """ import hou # Is this property being applied to a specific render type. if self.rendertype is not None: # Get the rendertype for the current pass. rendertype = get_property("renderer:rendertype") # If the type pattern doesn't match, abort. if not hou.patternMatch(self.rendertype, rendertype): return _logger.debug("Setting property '%s' to %s", self.name, self.value) # Update the property value. set_property(self.name, self.value)
def filter_instance(self): """Modify object properties. :return: """ if self.disable_displacement: set_property("object:displace", []) if self.disable_subd: set_property("object:rendersubd", 0) if self.disable_matte: if get_property("object:matte") or get_property("object:phantom"): set_property("object:renderable", False) elif get_property("object:surface") == "opdef:/Shop/v_matte": set_property("object:renderable", False)
def filter_instance(self): """Apply constant black shader to objects. :return: """ matte = get_property("object:matte") phantom = get_property("object:phantom") surface = get_property("object:surface") set_property("object:overridedetail", True) if matte or phantom or surface == "matte": set_property("object:phantom", 1) else: set_property("object:surface", self.CONST_SHADER.split()) set_property("object:displace", None)
def filterInstance(self): """Apply constant black shader to objects. :return: """ matte = get_property("object:matte") phantom = get_property("object:phantom") surface = get_property("object:surface") set_property("object:overridedetail", True) if matte or phantom or surface == "matte": set_property("object:phantom", 1) else: set_property("object:surface", self.CONST_SHADER.split()) set_property("object:displace", None)
def filterInstance(self): """Modify object properties. :return: """ if self.disable_displacement: set_property("object:displace", []) if self.disable_subd: set_property("object:rendersubd", 0) if self.disable_matte: if get_property("object:matte") or get_property("object:phantom"): set_property("object:renderable", False) elif get_property("object:surface") == "opdef:/Shop/v_matte": set_property("object:renderable", False)
def filterCamera(self): """Apply camera properties. :return: """ if self.res_scale is not None: resolution = get_property("image:resolution") resolution = _scale_resolution(resolution, self.res_scale) set_property("image:resolution", resolution) if self.sample_scale is not None: samples = get_property("image:samples") samples = _scale_samples(samples, self.sample_scale) set_property("image:samples", samples) if self.bucket_size is not None: set_property("image:bucket", self.bucket_size) # Set the blurquality values to 0 to disable blur. if self.disable_blur: set_property("renderer:blurquality", 0) set_property("renderer:rayblurquality", 0) # Set the deepresolver to have no args, thus stopping it from running. if self.disable_deep: set_property("image:deepresolver", []) if self.disable_tilecallback: set_property("render:tilecallback", "") if self.transparent_samples: set_property("image:transparentsamples", self.transparent_samples)
def filterPlane(self): """Modify image planes to ensure one will output Pz. This will disable all planes that are not C and Pz. :return: """ channel = get_property("plane:channel") if channel == "Pz": # If the channel is Pz but we've already forcibly set one to Pz # then we need to disable the plane. if self.data["set_pz"]: set_property("plane:disable", True) return # The plane is Pz and we have yet to indicate we've got a Pz so # store the data. else: self.data["set_pz"] = True return # If we haven't found a Pz plane yet and this channel isn't a primary # output channel then we will force it to be Pz. if not self.data["set_pz"] and channel not in ("C", "Of"): set_property("plane:variable", "Pz") set_property("plane:vextype", "float") set_property("plane:channel", "Pz") set_property("plane:pfilter", "minmax min") set_property("plane:quantize", None) self.data["set_pz"] = True # Disable any other planes. elif channel not in ("C", ): set_property("plane:disable", True)
def filter_camera(self): """Apply camera properties. :return: """ if self.res_scale is not None: resolution = get_property("image:resolution") resolution = _scale_resolution(resolution, self.res_scale) set_property("image:resolution", resolution) if self.sample_scale is not None: samples = get_property("image:samples") samples = _scale_samples(samples, self.sample_scale) set_property("image:samples", samples) if self.bucket_size is not None: set_property("image:bucket", self.bucket_size) # Set the blurquality values to 0 to disable blur. if self.disable_blur: set_property("renderer:blurquality", 0) set_property("renderer:rayblurquality", 0) # Set the deepresolver to have no args, thus stopping it from running. if self.disable_deep: set_property("image:deepresolver", []) if self.disable_tilecallback: set_property("render:tilecallback", "") if self.transparent_samples: set_property("image:transparentsamples", self.transparent_samples)
def filter_plane(self): """Modify image planes to ensure one will output Pz. This will disable all planes that are not C and Pz. :return: """ channel = get_property("plane:channel") if channel == "Pz": # If the channel is Pz but we've already forcibly set one to Pz # then we need to disable the plane. if self.data["set_pz"]: set_property("plane:disable", True) return # The plane is Pz and we have yet to indicate we've got a Pz so # store the data. self.data["set_pz"] = True return # If we haven't found a Pz plane yet and this channel isn't a primary # output channel then we will force it to be Pz. if not self.data["set_pz"] and channel not in ("C", "Of"): set_property("plane:variable", "Pz") set_property("plane:vextype", "float") set_property("plane:channel", "Pz") set_property("plane:pfilter", "minmax min") set_property("plane:quantize", None) self.data["set_pz"] = True # Disable any other planes. elif channel not in ("C",): set_property("plane:disable", True)