Ask a Question related to Macromedia Director 3D, Design and Development.
-
frank #1
Re: open and close the door
hi Agustín !!
Thx for the answer.
I think i ll need a variable to detect if the motion reach the end of the
portion open for then determine which portion of the animation have to
play...
My motion is 3333 ms long and there is my scrip to open the door :
on mouseUp me
thisSprite = sprite(me.spriteNum)
-- Get the mouse location, adjusted to the sprite,
-- in the old 2D manner.
theLoc = the mouseLoc - point(sprite(thisSprite).left,
sprite(thisSprite).top)
-- Find the model under the mouse closest to the camera
theModel = sprite(thisSprite).camera(1).modelUnderLoc(theLoc)
if theModel = member("19_anim").model("bouton_arriere") then
member(1).model("bouton_arriere").keyframeplayer.p layrate = 0.5
-- play
member(1).model("bouton_arriere").keyframeplayer.p lay("bouton_arriere-Motion
0", 0, 0, 1250, 1)
end if
end
frank Guest
-
open/close 2 doors at the same time
Im having trouble (again).. this time - I need to open/close two doors at the same time with the activation being from a button (object) that is not... -
open a door with havok
hello friends, at the moment i am working on a tool that uses the havok xtra. for the things i want to do, the most important thing is to use a... -
Click to open door
I made a door and want to open it by clicking on it. But when I rotate it to open it turns around its own centerpoint. Does anyone knowhow I can... -
Close or end an open movie
Hi I have three+ movies: movie1 movie2 movie3 Movie 1 has the option to play either Movie2 or Movie3. How can I close Movie2 when returning... -
how to close an open cursor
I got careless and had an infinite loop. Killed my session. Now my cursor is still open. I dont have a handler too it. How do I close it without... -
Agustín María Rodríguez #2
Re: open and close the door
frank wrote:
Yup. That´s true. You have a copuple of ways for accomplishing this.> I think i ll need a variable to detect if the motion reach the end of the
> portion open for then determine which portion of the animation have to
> play...
The easier is to set a variable TRUE or FALSE depending on the state od
the door:
property pDoorOpened
on mouseUp me
--mousePicking code
if pDoorOpened = FALSE then
--OPEN:
member(1).model("bouton_arriere").keyframeplayer.p lay("bouton_arriere-Motion0",
0, 0, 1250, 1)
pDoorOpened = TRUE
else
--CLOSE:
member(1).model("bouton_arriere").keyframeplayer.p lay("bouton_arriere-Motion0",
0, 0, 1250, -1, 1250)
pDoorOpened = FALSE
end if
But this doesn´t avoid the user clicking while the door is moving thus
messing up the motion. You´d have to add some detection to see if the
motion is playing or not.
property pDoorOpened
property pMember
property pMotionPlaying
on beginSprite me
pMember = member(1)
pMember.registerForEvent(#animationStarted, #forbidAnim, me)
pMember.registerForEvent(#animationEnded, #allowAnim, me)
end
on forbidAnim me --llamado por evento #animationStarted
pMotionPlaying = TRUE --se está reproduciendo un motion
end
on allowAnim me --llamado por evento #animationEnded
pMotionPlaying = FALSE --no hay nada en la playList
end
on mouseUp me
--mousePicking code
if pMotionPlaying = FALSE then
if pDoorOpened = FALSE then
--OPEN:
member(1).model("bouton_arriere").keyframeplayer.p lay("bouton_arriere-Motion0",
0, 0, 1250, 1)
pDoorOpened = TRUE
else
--CLOSE:
member(1).model("bouton_arriere").keyframeplayer.p lay("bouton_arriere-Motion0",
0, 0, 1250, -1, 1250)
pDoorOpened = FALSE
end if
end if
Take care... it´s all e-mail-Lingo. But it should give an idea of how
to handle this.
C´ya!
--
Agustín María Rodríguez | [email]agustin@OnWine.com.ar[/email] | [url]www.OnWine.com.ar[/url]
Agustín María Rodríguez Guest
-
frank #3
Re: open and close the door
oooOOh ! Augustin u my hero!!
IT S WORKS!!
U trully safe me man! thx!
I m an advanced user of Maya and if i can help u for something i'm your man.
ooh man i can believe it thx again.
frank Guest



Reply With Quote

