def writeDataToIfd(data, wrangler, cam, now): """Write AOV data to the ifd.""" import IFDapi # Call the 'pre_defplane' hook. If the function returns True, # return. if _callPreDefPlane(data, wrangler, cam, now): return # Start of plane block in IFD. IFDapi.ray_start("plane") # Primary block information. IFDapi.ray_property("plane", "variable", [data["variable"]]) IFDapi.ray_property("plane", "vextype", [data["vextype"]]) IFDapi.ray_property("plane", "channel", [data["channel"]]) if "quantize" in data: IFDapi.ray_property("plane", "quantize", [data["quantize"]]) # Optional AOV information. if "planefile" in data: planefile = data["planefile"] if planefile is not None: IFDapi.ray_property("plane", "planefile", [planefile]) if "lightexport" in data: IFDapi.ray_property("plane", "lightexport", [data["lightexport"]]) if "pfilter" in data: IFDapi.ray_property("plane", "pfilter", [data["pfilter"]]) if "sfilter" in data: IFDapi.ray_property("plane", "sfilter", [data["sfilter"]]) if "component" in data: IFDapi.ray_property("plane", "component", [data["component"]]) # Call the 'post_defplane' hook. if _callPostDefPlane(data, wrangler, cam, now): return # End the plane definition block. IFDapi.ray_end()
def writeToIfd(data, wrangler, cam, now): """Write the plane to the ifd. Args: data : (dict) The data dictionary containing output information. wrangler : (Object) A wrangler object. cam : (soho.SohoObject) The camera being rendered. now : (float) The parameter evaluation time. Raises: N/A Returns: None """ import IFDapi # Call the 'pre_defplane' hook. If the function returns True, # return. if _callPreDefPlane(data, wrangler, cam, now): return # Start of plane block in IFD. IFDapi.ray_start("plane") # Primary block information. IFDapi.ray_property("plane", "variable", [data["variable"]]) IFDapi.ray_property("plane", "vextype", [data["vextype"]]) IFDapi.ray_property("plane", "channel", [data["channel"]]) IFDapi.ray_property("plane", "quantize", [data["quantize"]]) # Optional plane information. if "planefile" in data: planefile = data["planefile"] if planefile is not None: IFDapi.ray_property("plane", "planefile", [planefile]) if "lightexport" in data: IFDapi.ray_property("plane", "lightexport", [data["lightexport"]]) if "pfilter" in data: IFDapi.ray_property("plane", "pfilter", [data["pfilter"]]) if "sfilter" in data: IFDapi.ray_property("plane", "sfilter", [data["sfilter"]]) # Call the 'post_defplane' hook. if _callPostDefPlane(data, wrangler, cam, now): return # End the plane definition block. IFDapi.ray_end()
def _write_data_to_ifd(data, wrangler, cam, now): """Write AOV data to the ifd. :param data: AOV data. :type data: dict :param wrangler: A SOHO wrangler. :type wrangler: object :param cam: A SOHO camera. :type cam: soho.SohoObject :param now: The evaluation time. :type now: float :return: Whether or not the hook was successful. :rtype bool """ import IFDapi # Call the 'pre_defplane' hook. If the function returns True, # return. if _call_pre_defplane(data, wrangler, cam, now): return # Start of plane block in IFD. IFDapi.ray_start("plane") # Primary block information. IFDapi.ray_property("plane", "variable", [data[consts.VARIABLE_KEY]]) IFDapi.ray_property("plane", "vextype", [data[consts.VEXTYPE_KEY]]) IFDapi.ray_property("plane", "channel", [data[consts.CHANNEL_KEY]]) if consts.QUANTIZE_KEY in data: IFDapi.ray_property("plane", "quantize", [data[consts.QUANTIZE_KEY]]) # Optional AOV information. if consts.PLANEFILE_KEY in data: planefile = data["planefile"] if planefile is not None: IFDapi.ray_property("plane", "planefile", [planefile]) if consts.LIGHTEXPORT_KEY in data: IFDapi.ray_property("plane", "lightexport", [data[consts.LIGHTEXPORT_KEY]]) if consts.PFILTER_KEY in data: IFDapi.ray_property("plane", "pfilter", [data[consts.PFILTER_KEY]]) if consts.SFILTER_KEY in data: IFDapi.ray_property("plane", "sfilter", [data[consts.SFILTER_KEY]]) if consts.COMPONENT_KEY in data: IFDapi.ray_property("plane", "component", [data[consts.COMPONENT_KEY]]) if consts.EXCLUDE_DCM_KEY in data: IFDapi.ray_property("plane", "excludedcm", [True]) # Call the 'post_defplane' hook. if _call_post_defplane(data, wrangler, cam, now): return # End the plane definition block. IFDapi.ray_end()
def writeDataToIfd(data, wrangler, cam, now): """Write AOV data to the ifd.""" import IFDapi # Call the 'pre_defplane' hook. If the function returns True, # return. if _callPreDefPlane(data, wrangler, cam, now): return # Start of plane block in IFD. IFDapi.ray_start("plane") # Primary block information. IFDapi.ray_property("plane", "variable", [data["variable"]]) IFDapi.ray_property("plane", "vextype", [data["vextype"]]) IFDapi.ray_property("plane", "channel", [data["channel"]]) if "quantize" in data: IFDapi.ray_property("plane", "quantize", [data["quantize"]]) # Optional AOV information. if "planefile" in data: planefile = data["planefile"] if planefile is not None: IFDapi.ray_property("plane", "planefile", [planefile]) if "lightexport" in data: IFDapi.ray_property("plane", "lightexport", [data["lightexport"]]) if "pfilter" in data: IFDapi.ray_property("plane", "pfilter", [data["pfilter"]]) if "sfilter" in data: IFDapi.ray_property("plane", "sfilter", [data["sfilter"]]) if "component" in data: IFDapi.ray_property("plane", "component", [data["component"]]) if "exclude_from_dcm" in data: IFDapi.ray_property("plane", "excludedcm", [True]) # Call the 'post_defplane' hook. if _callPostDefPlane(data, wrangler, cam, now): return # End the plane definition block. IFDapi.ray_end()