Announcement

Collapse
No announcement yet.

rigging control help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    for the case of the sphere radius i did use the "controler: ($Sphere01.radius.controller)" piece of code. It worked well in my initial scene but then stopped working when i tried to apply it in a new scene with a sphere in there called Sphere01.

    one of my misconceptions is that as you said $Sphere01.radius is only an number however if you add .controller to the end then the number becomes a controller. the other thing im not getting is you said your radius is an integer. wouldnt it really be a #float and not an #integer?

    so following on my misconception i figured that if i use (WM3_MC_GetValue $Box01.modifiers[#Colonel_Face_Morpher] 1) to find out the #float found in slot one of the morph then if i just added .controller to the end that it would give me a controller. for the morphing box can i type in $Box01.controller into the listener and have it list every single controller available to the Box01?

    im itching to try some things but im at school now (thank goodness i teach final cut and aftereffects and not maxscript)

    ---------------------------------------------------
    MSN addresses are not for newbies or warez users to contact the pros and bug them with
    stupid questions the forum can answer.

    Comment


    • #17
      actually i tried to type in $sphere01.controller to see if it would list radius as a controller and it doesnt, it just lists position, rotation and scale

      ---------------------------------------------------
      MSN addresses are not for newbies or warez users to contact the pros and bug them with
      stupid questions the forum can answer.

      Comment


      • #18
        Originally posted by Da_elf View Post
        for the case of the sphere radius i did use the "controler: ($Sphere01.radius.controller)" piece of code. It worked well in my initial scene but then stopped working when i tried to apply it in a new scene with a sphere in there called Sphere01.
        This probably occurred because the sphere01 was converted to an editable poly/mesh, which then loses it's primitive .radius property. You can test this out by executing this code.

        Create a primitive sphere, named sphere01
        execute
        Code:
        $Sphere01.radius = 100
        Convert that same sphere to an editable mesh/poly

        try and execute the same line...you'll get an error saying it can't find the property "radius" in the object "sphere01".

        You can show an object's properties by using the command "show" try this on a newly created primitive sphere

        Code:
        show $Sphere01
        it'll spit out the properties of the sphere, now convert it to a mesh/poly and retry it. It'll spit out new properties of an editable poly/mesh.

        one of my misconceptions is that as you said $Sphere01.radius is only an number however if you add .controller to the end then the number becomes a controller. the other thing im not getting is you said your radius is an integer. wouldnt it really be a #float and not an #integer?
        You are correct, it is actually a #float value. What I meant by integer was a number. But yes you're correct.

        so following on my misconception i figured that if i use (WM3_MC_GetValue $Box01.modifiers[#Colonel_Face_Morpher] 1) to find out the #float found in slot one of the morph then if i just added .controller to the end that it would give me a controller. for the morphing box can i type in $Box01.controller into the listener and have it list every single controller available to the Box01?
        Simply adding .controller will not work for things that aren't controllers. But after plenty of digging I found what you're after! When created the morpher mod already assigns a controller, but it's hard to locate. Here is the code for doing it in one line, the [1] signifies that it's in the first slot on the morpher modifier.

        Code:
        spinner spn_one "one" controller:($Box01.modifiers[#morpher])[1].controller
        That should make life easier. I haven't had much experience doing this kind of stuff, so thanks for the challenge.

        im itching to try some things but im at school now (thank goodness i teach final cut and aftereffects and not maxscript)
        Soon Padawan you'll be a master.
        -Colin
        Colin Senner

        Comment


        • #19
          WOW!!!!! that simple godly piece of code works!!!!

          ---------------------------------------------------
          MSN addresses are not for newbies or warez users to contact the pros and bug them with
          stupid questions the forum can answer.

          Comment


          • #20
            I tried and tried and tried to find the controller attached to the morpher mod.

            I read in the help files that everything that is keyable has a controller attached (and of
            course the morpher mod is), so I went digging. After many tries of

            $Box01.modifiers[#morpher].controller

            I found that it is a dynamic list that is updated whenever objects get added to the controller, and in turn needs an index! Aha!

            so adding the index [1] after ($Box01.modifiers[#morpher])[1] will mean the first valid object in the slot, and return the controller correctly. What a pain to find.

            PS. I still hold to my original code working perfectly as well doing the same thing, but mine is able to do more than this, but this is easier if you need just a direct connection.

            -Colin
            Colin Senner

            Comment


            • #21
              actually i knew there was the index of 1 however my problem was i didnt know if i needed to define it as 1 or .1 or (1) but you figured it out as [1] now im working on the delete key part. basically since my spinner now shows with the red brackets indecating there is a key present for that controller my X button will be used to delete that particular key. using your controller im able to atleast use
              Code:
              selectKeys ($box01.modifiers[#morpher] [1])
              deleteKeys ($Box01.modifiers[#morpher])[1].controller
              but basically thats just selects aaaalll of the keys for that controller and deletes them not just the one key i want. basically i need to use
              Code:
              selectKeys ($box01.modifiers[#morpher] [1]) [ <interval> | <time> ]
              deleteKeys ($Box01.modifiers[#morpher])[1].controller #selected
              but ive no idea what to put for the time. i tried using " (currentTime as integer)/TicksPerFrame " but that didnt work at all.

              somehow it needs to select the key thats at that current frame.

              ---------------------------------------------------
              MSN addresses are not for newbies or warez users to contact the pros and bug them with
              stupid questions the forum can answer.

              Comment


              • #22
                you were so close

                Code:
                selectKeys ($Box01.modifiers[#morpher])[1] currentTime
                deleteKeys ($Box01.modifiers[#morpher])[1].controller #selection
                Have you seen the sample code for "Enhance the Morpher Modifier With Floating Controls" in the maxscript ref?
                Eric Boer
                Dev

                Comment


                • #23
                  this piece of code isnt in there... (but it does work very well)
                  Last edited by Da_elf; 16-12-2007, 05:04 AM.

                  ---------------------------------------------------
                  MSN addresses are not for newbies or warez users to contact the pros and bug them with
                  stupid questions the forum can answer.

                  Comment


                  • #24
                    final code

                    Code:
                    try ( closeRolloutFloater Anim_Controls ) catch ()
                    rollout Facial "Controls" width:512 height:434
                    (
                    spinner spn_one "one" controller:($Box01.modifiers[#morpher])[1].controller
                    button btn1 "X" pos:[67,81] width:15 height:15
                    	on btn1 pressed do 
                    	(
                    	deselectKeys $box01
                    	selectKeys ($Box01.modifiers[#morpher])[1] currentTime
                    	deleteKeys ($Box01.modifiers[#morpher])[1].controller #selection 
                    )
                    Anim_Controls = newRolloutFloater "Animation Controls" 200 110
                    addRollout Facial Anim_Controls

                    ---------------------------------------------------
                    MSN addresses are not for newbies or warez users to contact the pros and bug them with
                    stupid questions the forum can answer.

                    Comment


                    • #25
                      You have a syntax error. You need to close your event handler "on btn1 pressed do". You have an open parethesis.

                      Should look like this

                      Code:
                      try ( closeRolloutFloater Anim_Controls ) catch ()
                      rollout Facial "Controls" width:512 height:434
                      (
                      spinner spn_one "one" controller:($Box01.modifiers[#morpher])[1].controller
                      button btn1 "X" pos:[67,81] width:15 height:15
                      	on btn1 pressed do 
                      	(
                      	     deselectKeys $box01
                      	     selectKeys ($Box01.modifiers[#morpher])[1] currentTime
                      	     deleteKeys ($Box01.modifiers[#morpher])[1].controller #selection 
                              )
                      )
                      Anim_Controls = newRolloutFloater "Animation Controls" 200 110
                      addRollout Facial Anim_Controls
                      Colin Senner

                      Comment


                      • #26
                        yeah. i caught that one later down the line. seeing as how it was the end of the rollout anyhow it never noticed it and worked normally. but i did catch it. i wish the maxscript editor worked like how the AGS editor works (for anyone interested in ooooold adventure point and click games ou would love AGS)
                        http://www.adventuregamestudio.co.uk/

                        ---------------------------------------------------
                        MSN addresses are not for newbies or warez users to contact the pros and bug them with
                        stupid questions the forum can answer.

                        Comment


                        • #27
                          Max2008 ships with a much better Maxscript editor...
                          Colin Senner

                          Comment


                          • #28
                            well im still working on 8 right now.

                            ---------------------------------------------------
                            MSN addresses are not for newbies or warez users to contact the pros and bug them with
                            stupid questions the forum can answer.

                            Comment


                            • #29
                              Originally posted by Da_elf View Post
                              this piece of code isnt in there... (but it does work very well)
                              True, the delete key part is not in there but it could be added, what is nice is the the controls are built dynamically
                              Eric Boer
                              Dev

                              Comment


                              • #30
                                i was under the impression that there were no controlls in that. i thought it was a progress meter that dynamically updated with the morphing of the teapot. my code also updates and is way shorter (i should say "our code" hehe)

                                ---------------------------------------------------
                                MSN addresses are not for newbies or warez users to contact the pros and bug them with
                                stupid questions the forum can answer.

                                Comment

                                Working...
                                X