Run animation when object not in frustrum?

Shaders, Level design, Sound design, Special effects

Run animation when object not in frustrum?

Postby lcocea » 2017-09-23 12:38

I have just realized that one of the longstanding "bugs" in my code, where an animation triggered by a sensor randomly fails to run, is due to the object not being in the frustrum for the entire duration of the animation, which only runs once. How can I (temporarily) force this particular object to be rendered when out of frustrum? I would like the animation to actually run/be rendered even when the animated object is not visible to the active camera.
lcocea
Platinum Boarder
Platinum Boarder
 
Posts: 574
Joined: 2012-06-07 03:12

Re: Run animation when object not in frustrum?

Postby .eb » 2017-09-26 17:21

Selecting the object that has the animation bank, and in Attributes panel under the animation controller; try deselecting the "Disable when out of frustrum" ...perhaps this doesn't work as you like ?

Maybe setting the object in a zone and using the zone to activate the object ? Try making a new AI for making easy ZONES...like so..
You would put this AI onto a helper..or perhaps some other object..
It will use the local space of the object it is attached to..it's dead simple really.
[[My apologies for not following the s/b/n prefix-naming standard in this script.]]

oninit..
Code: Select all
    local s = application.getCurrentUserScene()
    local minx,miny,minz  = object.getTranslation ( this.getObject ( ), object.kGlobalSpace )
     
    local ActZoneMin = scene.createActivationZone (s, this.ObjTagAZName ( ), minx,miny,minz,(minx+this.maxx()),(miny+this.maxy()),(minz+this.maxz())  )
    local zone2On = scene.enableActivationZone ( s, this.ObjTagAZName ( ), true )
    
    if this.Obj2Act1 ( ) ~= "" then
    object.enableZoneActivation (scene.getTaggedObject (s,this.Obj2Act1 ( )), true)
    end
   
    if this.Obj2Act2( ) ~= "" then
    object.enableZoneActivation (scene.getTaggedObject (s,this.Obj2Act2 ( )), true)
    end
   
    if this.Obj2Act3( ) ~= "" then
    object.enableZoneActivation (scene.getTaggedObject (s,this.Obj2Act3 ( )), true)
    end


and use Handlers:
onActivateZone()
onDeActivateZone()

Variables for AI model:
numbers -> maxx,maxy,maxz
strings -> Obj2Act1,Obj2Act2,Obj2Act3,ObjTagAZName
.eb
Platinum Boarder
Platinum Boarder
 
Posts: 378
Joined: 2010-11-10 16:47
Location: Syracuse NY

Re: Run animation when object not in frustrum?

Postby lcocea » 2017-09-26 17:37

Thanks for your tips! I'll give it a try and follow up here.
lcocea
Platinum Boarder
Platinum Boarder
 
Posts: 574
Joined: 2012-06-07 03:12

Re: Run animation when object not in frustrum?

Postby lcocea » 2017-09-27 01:40

.eb wrote:Selecting the object that has the animation bank, and in Attributes panel under the animation controller; try deselecting the "Disable when out of frustrum" ...perhaps this doesn't work as you like ?

It does. It's a complex object and I never thought to look under the animation controller for that particular mesh :shock: This was the solution. Thanks!
lcocea
Platinum Boarder
Platinum Boarder
 
Posts: 574
Joined: 2012-06-07 03:12

Re: Run animation when object not in frustrum?

Postby .eb » 2017-09-27 01:45

ah good. ('And that zone snippet is nice to have around for the odd use.)
.eb
Platinum Boarder
Platinum Boarder
 
Posts: 378
Joined: 2010-11-10 16:47
Location: Syracuse NY


Return to Creation

Who is online

Users browsing this forum: No registered users and 5 guests

cron