sketchucation logo sketchucation
    • 登入
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🔌 Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download

    You Decide Competition!

    已排程 已置頂 已鎖定 已移動 SketchyPhysics
    51 貼文 8 Posters 5.6k 瀏覽 8 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • C 離線
      CPhillips
      最後由 編輯

      @wacov said:

      Chris, how are you managing to hide and unhide components using script? There are parts of the script you made that I understand, and parts I don't, but it seems the crucial thing is the 'ent.hidden'. The 'ent' is a variable, but I can't find the point where it was created, nor where it was assigned to any specific item. So, how can I assign variables to components? (With the purpose of hiding/unhiding them on command)

      The code looks like this:

      
              for ent in $curEvalGroup.definition.entities
                  if ent.definition.name == name+("%02d"%frame)
                      ent.hidden = false
                  else
                      ent.hidden = true
                  end
              end
      
      

      First is this:

      $curEvalGroup.definition.entities
      

      Without going into details, this amounts to a list of every group inside the hero characters group.

      for ent in $curEvalGroup.definition.entities
      
      

      This means set to be for every entity (groups in this case) inside the character set variable "ent" to be
      that group and then...

      if ent.definition.name == name+("%02d"%frame)
      

      If the "ent" has a certain name then hide or unhide.

      ent.hidden=true 
      
      

      Remember "ent" is a Sketchup group and this is how you hide a group using Ruby.

      A simpler example:

      
      if(frame==100)
         $curEvalGroup.hidden=true
      elsif(frame==200)
         $curEvalGroup.hidden=false
      end
      
      

      This will hide the object at frame 100 and show it again at frame 200

      1 條回覆 最後回覆 回覆 引用 0
      • W 離線
        Wacov
        最後由 編輯

        Okay... that will be useful, but now I'm wondering how you changed the evaluation group to something outside the group it was written in 😄

        Is that what the first part of the script is for?

        Also, is it possible to change the default SU material of an object using script? Like when you paint a group, any surfaces within with the default paint will change.

        http://sketchup.google.com/3dwarehouse/cldetails?mid=3096a836877fb9af6cd8ad826e9017b8&prevstart=0

        1 條回覆 最後回覆 回覆 引用 0
        • B 離線
          BTM
          最後由 編輯

          You can do that through styles, or when using the paint bucket on a default coloured face, hold shift.

          1 條回覆 最後回覆 回覆 引用 0
          • W 離線
            Wacov
            最後由 編輯

            No, it has to be through script. There must be a way, because plugins are able to change the material...

            http://sketchup.google.com/3dwarehouse/cldetails?mid=3096a836877fb9af6cd8ad826e9017b8&prevstart=0

            1 條回覆 最後回覆 回覆 引用 0
            • C 離線
              CPhillips
              最後由 編輯

              @wacov said:

              Okay... that will be useful, but now I'm wondering how you changed the evaluation group to something outside the group it was written in 😄

              Is that what the first part of the script is for?

              Also, is it possible to change the default SU material of an object using script? Like when you paint a group, any surfaces within with the default paint will change.

              I dont know what you mean. I didnt exactly change the evaluation group. "$curEvalGroup" is the group that the code is running on.

              You know how you can make one object in SU and make it a component then copy it. Now when you edit one all of them change. That is because there is one object "definition" and 0 or more "instances" of that object. Every group is actually a instance.

              $curEvalGroup.definition.entities
              

              Given an instance ($curEvalGroup) get its definition and then get the entities in that definition.

              The first part of the script just gets the x,y,z location of the body.

              BTW "$" means global varible in Ruby. You can use the $curEvalGroup but do not and I mean do not try to make new ones. You could mess things up pretty easy.

              1 條回覆 最後回覆 回覆 引用 0
              • H 離線
                hobbnob
                最後由 編輯

                physicsguy you didnt' tell me your challenge decision. i'm using the default option that i decided on a few weeks ago in case of such an event. in future all group decisions for the sp challenges are banned.

                My WIP Thread:Here

                1 條回覆 最後回覆 回覆 引用 0
                • B 離線
                  BTM
                  最後由 編輯

                  ...Just pick whatever one was voted for the most on the other thread. I'd say that would be the best solution.

                  1 條回覆 最後回覆 回覆 引用 0
                  • H 離線
                    hobbnob
                    最後由 編輯

                    he'd created loads of polls and voting places dotted around, theres no way i'm goign through all of that, i might as well tell you now, the next challenge will be for a motorcycle.

                    My WIP Thread:Here

                    1 條回覆 最後回覆 回覆 引用 0
                    • B 離線
                      BTM
                      最後由 編輯

                      😐 That's pretty basic and simple...
                      ... I'd still go for animated character. I'd already started, thinking it was the probable topic, as it seems to be on the top of the forum poll, and the only other poll I could find is one on the warehouse; but that wouldn't change it still.

                      1 條回覆 最後回覆 回覆 引用 0
                      • P 離線
                        Physicsguy1
                        最後由 編輯

                        What The?!!!!!!!!!???????? its an animated character, now give them what they voted for. motorcycle is too relevant to the desert vehicle. we don't need another vehicle

                        1 條回覆 最後回覆 回覆 引用 0
                        • P 離線
                          pr0
                          最後由 編輯

                          hey guys, what about something like transformable architecture. i don't know if this will be too difficult to pull off, but its worth a try.

                          here are some links 😄

                          403 Forbidden

                          favicon

                          (www.gatewaycoalition.org)

                          403 Forbidden

                          favicon

                          (www.gatewaycoalition.org)

                          403 Forbidden

                          favicon

                          (www.gatewaycoalition.org)

                          http://i.treehugger.com/images/2007/10/24/chuck28.jpg

                          1 條回覆 最後回覆 回覆 引用 0
                          • 1
                          • 2
                          • 3
                          • 3 / 3
                          • 第一個貼文
                            最後的貼文
                          Buy SketchPlus
                          Buy SUbD
                          Buy WrapR
                          Buy eBook
                          Buy Modelur
                          Buy Vertex Tools
                          Buy SketchCuisine
                          Buy FormFonts

                          Advertisement