<commit_before>from .rman_translator import RmanTranslator
from ..rman_sg_nodes.rman_sg_alembic import RmanSgAlembic
from ..rfb_utils import filepath_utils
from ..rfb_utils import transform_utils
from ..rfb_utils import string_utils
from ..rfb_logger import rfb_log

class RmanAlembicTranslator(RmanTranslator):

    def __init__(self, rman_scene):
        super().__init__(rman_scene)
        self.bl_type = 'ALEMBIC' 

    def export(self, ob, db_name):

        sg_node = self.rman_scene.sg_scene.CreateProcedural(db_name)
        sg_node.Define("DynamicLoad", None)
        rman_sg_alembic = RmanSgAlembic(self.rman_scene, sg_node, db_name)

        return rman_sg_alembic

    def export_deform_sample(self, rman_sg_alembic, ob, time_sample):
        pass

    def update(self, ob, rman_sg_alembic):
        rm = ob.renderman
        abc_filepath = filepath_utils.get_real_path(rm.abc_filepath)
        bounds = (-100000, 100000, -100000, 100000, -100000, 100000 )

        primvar = rman_sg_alembic.sg_node.GetPrimVars()
        primvar.SetString(self.rman_scene.rman.Tokens.Rix.k_dsoname, 'AlembicProcPrim')
        primvar.SetFloatArray(self.rman_scene.rman.Tokens.Rix.k_bound, bounds, 6)

        shutter_interval = self.rman_scene.bl_scene.renderman.shutter_angle / 360.0
        shutter_open, shutter_close = 0, shutter_interval   
        abc_frame = rm.abc_frame
        if rm.abc_use_scene_frame:
            rman_sg_alembic.is_frame_sensitive = True
            abc_frame = float(self.rman_scene.bl_frame_current)       
        else:
            rman_sg_alembic.is_frame_sensitive = False

        abc_args = "-filename %s -frame %f -fps %f -shutteropen %f -shutterclose %f" % (abc_filepath, abc_frame, rm.abc_fps, shutter_open, shutter_close)

        primvar.SetString(self.rman_scene.rman.Tokens.Rix.k_data, abc_args)

        rman_sg_alembic.sg_node.SetPrimVars(primvar)        

<commit_msg>Add the -ccw flag to the alemic procedural args.<commit_after>from .rman_translator import RmanTranslator
from ..rman_sg_nodes.rman_sg_alembic import RmanSgAlembic
from ..rfb_utils import filepath_utils
from ..rfb_utils import transform_utils
from ..rfb_utils import string_utils
from ..rfb_logger import rfb_log

class RmanAlembicTranslator(RmanTranslator):

    def __init__(self, rman_scene):
        super().__init__(rman_scene)
        self.bl_type = 'ALEMBIC' 

    def export(self, ob, db_name):

        sg_node = self.rman_scene.sg_scene.CreateProcedural(db_name)
        sg_node.Define("DynamicLoad", None)
        rman_sg_alembic = RmanSgAlembic(self.rman_scene, sg_node, db_name)

        return rman_sg_alembic

    def export_deform_sample(self, rman_sg_alembic, ob, time_sample):
        pass

    def update(self, ob, rman_sg_alembic):
        rm = ob.renderman
        abc_filepath = filepath_utils.get_real_path(rm.abc_filepath)
        bounds = (-100000, 100000, -100000, 100000, -100000, 100000 )

        primvar = rman_sg_alembic.sg_node.GetPrimVars()
        primvar.SetString(self.rman_scene.rman.Tokens.Rix.k_dsoname, 'AlembicProcPrim')
        primvar.SetFloatArray(self.rman_scene.rman.Tokens.Rix.k_bound, bounds, 6)

        shutter_interval = self.rman_scene.bl_scene.renderman.shutter_angle / 360.0
        shutter_open, shutter_close = 0, shutter_interval   
        abc_frame = rm.abc_frame
        if rm.abc_use_scene_frame:
            rman_sg_alembic.is_frame_sensitive = True
            abc_frame = float(self.rman_scene.bl_frame_current)       
        else:
            rman_sg_alembic.is_frame_sensitive = False

        abc_args = "-filename %s -frame %f -fps %f -shutteropen %f -shutterclose %f -ccw" % (abc_filepath, abc_frame, rm.abc_fps, shutter_open, shutter_close)

        primvar.SetString(self.rman_scene.rman.Tokens.Rix.k_data, abc_args)

        rman_sg_alembic.sg_node.SetPrimVars(primvar)        


{'fraction_non_alphanumeric': 0.08721532091097309, 'fraction_numerical': 0.021739130434782608, 'mean_word_length': 3.280177187153931, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6260904', 'n_tokens_mistral': 1509, 'n_tokens_neox': 1394, 'n_words': 231}