Ejemplo n.º 1
0
def face_drone():
    s2 = lookat.LookAt(BISMARK, GUNNER)
    s2.set_target_pmx(DRONE_MODEL)
    s2.set_target_vmd(DRONE_MOTION)
    s2.set_target_bone('センター')
    s2.set_additional_frames([350, 1250])
    s2.set_frame_ranges([SEQ2_RANGE])
    return s2.look_at()
Ejemplo n.º 2
0
def face_camera():
    s1 = lookat.LookAt(BISMARK, GUNNER)
    s1.set_target_vmd(CAMERA)
    s1.set_constraint('両目', [(20, 30, 0), (0.1, 0.1, 0)])
    s1.set_additional_frames([120])
    s1.set_frame_ranges([SEQ1_RANGE, (1251, 1350)])
    frames = s1.look_at()
    return frames
Ejemplo n.º 3
0
def trace_camera(args):
    l = lookat.LookAt(args.from_pmx, args.from_vmd)
    l.set_target_vmd(args.cam_vmd)
    if args.omega:
        omega = math.radians(float(args.omega))
        l.set_omega_limit(omega)
    set_common_options(args, l)
    heading_frames = l.look_at()
    vmdout = vmdutil.Vmdio()
    vmdout.set_frames('bones', heading_frames)
    vmdout.store(args.outfile)
    return
Ejemplo n.º 4
0
    def __init__(self,
                 name="GLSpotLight",
                 parent=None,
                 enabled=True,
                 intensity=1.0,
                 ambient=None,
                 diffuse=None,
                 specular=None,
                 constant_attenuation=1.0,
                 linear_attenuation=0.0,
                 quadratic_attenuation=0.0,
                 exponent=0.0,
                 cutoff=45.0,
                 target=vec3(0, 0, 0),
                 cast_shadow=False,
                 auto_insert=True,
                 **params):

        _initWorldObject(self,
                         baseClass=_core.GLSpotLight,
                         name=name,
                         parent=parent,
                         auto_insert=auto_insert,
                         **params)

        target = vec3(target)

        # Target
        self.target_slot = Vec3Slot(target)
        self.addSlot("target", self.target_slot)

        self.enabled = enabled
        self.intensity = intensity
        if ambient != None:
            self.ambient = vec3(ambient)
        if diffuse != None:
            self.diffuse = vec3(diffuse)
        if specular != None:
            self.specular = vec3(specular)
        self.constant_attenuation = constant_attenuation
        self.linear_attenuation = linear_attenuation
        self.quadratic_attenuation = quadratic_attenuation
        self.exponent = exponent
        self.cutoff = cutoff

        self.cast_shadow = cast_shadow

        # Create the internal LookAt component
        self._lookat = lookat.LookAt()
        self._lookat.name = "GLTargetSpot_LookAt"
        self._lookat.output_slot.connect(self.rot_slot)
        self.pos_slot.connect(self._lookat.pos_slot)
        self.target_slot.connect(self._lookat.target_slot)
Ejemplo n.º 5
0
def trace_model(args):
    l = lookat.LookAt(args.from_pmx, args.from_vmd)
    l.set_target_pmx(args.to_pmx)
    l.set_target_vmd(args.to_vmd)
    if args.target_bone:
        target_bone = args.target_bone
        l.set_target_bone(target_bone)
    trace_camera.set_common_options(args, l)
    heading_frames = l.look_at()
    vmdout = vmdutil.Vmdio()
    vmdout.set_frames('bones', heading_frames)
    vmdout.store(args.outfile)
    return
Ejemplo n.º 6
0
    def __init__(self,
                 name = "TargetCamera",
                 fov = 45.0,
                 target = vec3(0,0,0),
                 roll = 0.0,
                 up = None,
                 fstop = 0,
                 focallength = 0,
                 **params):
        
        camerabase.CameraBase.__init__(self, name=name, **params)

        target = vec3(target)

        # FOV
        self.fov_slot = slots.DoubleSlot(fov)
        self.addSlot("fov", self.fov_slot)

        # Target
        self.target_slot = slots.Vec3Slot(target)
        self.addSlot("target", self.target_slot)

        # Roll
        self.roll_slot = slots.DoubleSlot(roll)
        self.addSlot("roll", self.roll_slot)

        # Up
        self.up_slot = slots.Vec3Slot()
        self.addSlot("up", self.up_slot)
        if up==None:
            self.up_slot.setValue(getScene().up)
        else:
            self.up_slot.setValue(vec3(up))

        self._lookat = lookat.LookAt()
        self._lookat.name = "TargetCamera_LookAt"
        self._lookat.output_slot.connect(self.rot_slot)
        self.pos_slot.connect(self._lookat.pos_slot)
        self.target_slot.connect(self._lookat.target_slot)
        self.roll_slot.connect(self._lookat.roll_slot)
        self.up_slot.connect(self._lookat.up_slot)

        # fstop
        self.fstop_slot = slots.DoubleSlot(fstop)
        self.addSlot("fstop", self.fstop_slot)
        
        # focal length
        self.focallength_slot = slots.DoubleSlot(focallength)
        self.addSlot("focallength", self.focallength_slot)
Ejemplo n.º 7
0
    def __init__(self,
                 name="GLDistantLight",
                 parent=None,
                 enabled=True,
                 intensity=1.0,
                 ambient=None,
                 diffuse=None,
                 specular=None,
                 target=vec3(0,0,0),
                 cast_shadow = False,
                 auto_insert=True,
                 **params
                 ):
        exec _preInitWorldObject
        _core.GLDistantLight.__init__(self, name)

        _initWorldObject(self, name=name, parent=parent,
                         auto_insert=auto_insert,
                         **params)

        target = vec3(target)

        # Target
        self.target_slot = Vec3Slot(target)
        self.addSlot("target", self.target_slot)

        self.enabled = enabled
        self.intensity = intensity
        if ambient!=None:
            self.ambient = vec3(ambient)
        if diffuse!=None:
            self.diffuse = vec3(diffuse)
        if specular!=None:
            self.specular = vec3(specular)

        self.cast_shadow = cast_shadow

        # Create the internal LookAt component
        self._lookat = lookat.LookAt()
        self._lookat.name = "GLTargetDistant_LookAt"
        self._lookat.output_slot.connect(self.rot_slot)
        self.pos_slot.connect(self._lookat.pos_slot)
        self.target_slot.connect(self._lookat.target_slot)
Ejemplo n.º 8
0
    def __init__(
        self,
        name="SpotLight3DS",
        enabled=True,  # off
        intensity=1.0,  # multiplier
        see_cone=False,
        roll=0.0,
        outer_range=0,
        inner_range=0,
        attenuation=0,
        rectangular_spot=0,
        shadowed=False,
        shadow_bias=0,
        shadow_filter=4.0,
        shadow_size=256,
        spot_aspect=0,
        use_projector=False,
        projector=0,
        overshoot=False,
        ray_shadows=False,
        ray_bias=False,
        hotspot=43,
        falloff=45,
        color=(1, 1, 1),
        target=vec3(0, 0, 0),  # spot
        #                 transform = None,
        #                 pos = None, rot = None, scale = None,
        #                 pivot= None,
        #                 offsetTransform = None,
        #                 auto_insert=True,
        **params):

        LightSource.__init__(self, name=name, **params)

        target = vec3(target)

        # Target
        self.target_slot = Vec3Slot(target)
        self.addSlot("target", self.target_slot)

        self.enabled = enabled
        self.intensity = intensity
        self.attenuation = attenuation
        self.attenuation = attenuation
        self.inner_range = inner_range
        self.outer_range = outer_range
        self.falloff = falloff
        self.hotspot = hotspot
        self.overshoot = overshoot
        self.color = color
        self.shadowed = shadowed
        self.cast_shadow = shadowed
        self.shadow_filter = shadow_filter
        self.shadow_bias = shadow_bias
        self.shadow_size = shadow_size

        # Create the internal LookAt component
        self._lookat = lookat.LookAt()
        self._lookat.name = "SpotLight3DS_LookAt"
        self._lookat.output_slot.connect(self.rot_slot)
        self.pos_slot.connect(self._lookat.pos_slot)
        self.target_slot.connect(self._lookat.target_slot)