10 Replies Latest reply on Sep 28, 2006 7:37 PM by tyree_2

    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 linked to the doors. How can i get this done? In addition to this, can i get lights to turn on/off at this very same moment. For instance green light you can open the door... red light door is already open.. or in process of open/close. Any help is appreciated!
        • 1. Re: open/close 2 doors at the same time
          tyree_2 Level 2
          there is a pause and play command for animations. If you look in the help files you should find it
          • 2. Re: open/close 2 doors at the same time
            JAH_P Level 1
            great feature!! But..... unfortunately i cant get it to function for both doors to animate at the same time. So far which ever door i place it on first is the only to work. Also if i group the object in 3DS before importing it in then the animation doesnt work at all. Any quick answers -- ive got to give up tonight and send out something for the client, would be great with function but if not.. id still like to know the answer for future work. Thanks.
            • 3. Re: open/close 2 doors at the same time
              tyree_2 Level 2
              once grouped the animation is attached to the group not the individual doors address the group. member(1).model("group01") something along these lines use 3dpi
              • 4. Re: open/close 2 doors at the same time
                JAH_P Level 1
                hmmm.. message didnt send, lets try this again..
                When i group everything in max before export, then import into director i no longer have the ability to attach the play animation function on the file. no sure what to do... when i export the file from max and preview it..when they are separate objects they will animate in the preview, when grouped nothing moves in the preview (not sure if this is trying to tell me something). Also, would it help to try grouping once in director? ..... what did you mean by "use 3dpi"?
                • 5. Re: open/close 2 doors at the same time
                  duckets Level 1
                  Do you really need to use pre-rendered animations to open doors? If they just swing on a hinge or slide open, perhaps you could simply use 'rotate' or 'translate' commands to rotate or slide the door object to the correct position, frame by frame? That's how I'd approach it unless they are unusual doors with bits that slide in different directions such as a complex airlock or something.

                  - Ben
                  • 6. Re: open/close 2 doors at the same time
                    tyree_2 Level 2
                    use 3dpi to find out information in the scene like what animation is attached to what object and the name of that animation
                    you may not be addressing the animations by the right name
                    • 7. Re: open/close 2 doors at the same time
                      dsdsdsdsd Level 1

                      I would use an object-oriented approach, using parent scripts as the object envelop, so to speak;

                      if you are not familiar with object-oriented programming, you would need at least a day to get it under control; once you have figured it out you would create one generic 'door' object which would have rotation amounts and opening and closing methods/functions in it;

                      when you would instantiate a new door 'object' you would feed it the door model that you want to open/close;
                      [ code]
                      global purple_door_object
                      global yellow_door_object

                      on startmovie
                      purple_door = member("your_world").model("purple_door")
                      purple_door_object = script( "generic_parent_script_for_doors" ).new( me , purple_door )
                      yellow_door = member("your_world").model("yellow_door")
                      yellow_door_object = script( "generic_parent_script_for_doors" ).new( me , yellow_door )

                      so at the beginning of the movie you create the door 'objects';

                      later when you press a button or whatever you would call one of these objects, or both, and tell them to do their thing, such as 'open';
                      global purple_door_object
                      global yellow_door_object

                      on someevent
                      purple_door_object.open_it( )
                      yellow_door_object.open_it( )

                      your generic door object parent script would look something like this:
                      property this_door_model
                      property total_degrees_to_open
                      property amount_to_open_each_frame

                      on new me , arg_door_model
                      this_door_model = arg_door_model
                      total_degrees_to_open = 85
                      amount_to_open_each_frame = 3
                      return me

                      on open_it me
                      -- the 'me' thing is confusing; you will have to read up on it; I can't explain it;
                      -- here you will probably create a timeout object that will call a rotate script every 50 milliseconds or so; and you will have to do the math to see if the door is completely open yet; if so then kill the timeout

                      I hope that this helps;

                      • 8. Re: open/close 2 doors at the same time
                        JAH_P Level 1
                        First off to duckets - Yes this is unfortunately an airlock! HA! good guess. The more i get into this the more animations i want to function with the press one "object". So rotate and transform dont look like they will help at all. (at least from what i understand with these two functions) Unfortunately im still hoping tyree_2 can shuffle through my confusion to help me with the 'play animation' function. Otherwise ive got to look at what dsdsdsdsd put together for me.. and ive got to be honest here director is a great program but code and i dont get along, so drag and drop functions are always the way id rather go! <- but this is indeed the reason im having this problem to begin with.
                        I will however give this a try and yes it will probably take a day or two to even grasp what you've type out. I'll post a follow up hopefully this weekend. Thanks again for all the time spent in helping me figure this out!
                        • 9. Re: open/close 2 doors at the same time
                          _lw Level 1
                          at the moment i don't have enough time to explain the situation completely. this is little bit different from your problem, but explains how to controll the keyframeplayer. It is designed to work with files that are created with cinema4D where the name of a keyframeanimation is named as the model.
                          i think in max the exported keyframeanimation has at the end of the name the string "-key".

                          Maybe you take a look at this example:
                          http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=11&catid=268&threadid =1088540&highlight_key=y&keyword1=open%20doors

                          I think you can extract something out of it. You would have to create an event where two keyframeplayer are activated at the same time...

                          hope you can extract something out of it...

                          • 10. Re: open/close 2 doors at the same time
                            tyree_2 Level 2
                            you can try linking one door to the other in max but I suspect its a naming problem, when you use the play command. when you use a seperate animation for each door there should be no problem