How to use the translators.dupli.DupliListBuilder function in translators

To help you get started, we’ve selected a few translators examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appleseedhq / blenderseed / translators / dupli.py View on Github external
def __set_instance_transforms(self, obj, scene, time):
        with DupliListBuilder(obj, scene, self.__settings):
            for i, mesh in enumerate(self.__object_translators):
                mesh.set_transform(time, obj.dupli_list[i].matrix)
github appleseedhq / blenderseed / translators / dupli.py View on Github external
def __create_dupli_instances(self, obj, scene, settings):
        with DupliListBuilder(obj, scene, settings):
            for dupli in obj.dupli_list:
                # Create translators for dupli instances.
                if dupli.object.type == 'MESH':
                    obj_key = ObjectKey (dupli.object)
                    mesh_key = ObjectKey(dupli.object.data)

                    is_modified = dupli.object.is_modified(scene, 'RENDER')

                    if is_modified == False and mesh_key in self.__datablock_to_translator:
                        logger.debug("Creating instance translator for object %s, master obj: %s", obj_key, mesh_key)

                        master_translator = self.__datablock_to_translator[mesh_key]
                        self.__object_translators.append(InstanceTranslator(dupli.object, master_translator, self.asset_handler))
                        master_translator.add_instance()
                    else:
                        logger.debug("Creating mesh translator for object %s", obj_key)
github appleseedhq / blenderseed / translators / dupli.py View on Github external
def __update_instance_transforms(self, obj, scene, time):
        with DupliListBuilder(obj, scene, self.__settings):
            for i, mesh in enumerate(self.__object_translators):
                mesh.update_transform(time, obj.dupli_list[i].matrix)