No announcement yet.

Color Picker Question TW

  • Filter
  • Time
  • Show
Clear All
new posts

  • Color Picker Question TW

    Helllo All,

    I have a color picker in TW that i can use to change the color of a circle in a scene. That works fine. What i want to do is have the user be able to select a few List box items and change those to the same color. The catch is that i want to use the List Box item index to change the ControlObject in TW and feed it that color so i dont have like 100+ control objects in the template.

    So imagine a scene with 150 counties. The user needs to highlight each county with a color or the same color. There is a control id for each county in the scene. In the template the list box has all 150 counties to choose from. The user can use the color wheel to pick whatever color they want.

    The user can either choose 1 county and change that item or choose multiple counties and change the colors at the same time. I wish i could upload the template but this site does not allow me.

    Thanks for any feedback or suggestions

  • #2
    Have a look at this post, there might be a few colorpicker clues here.


    • #3
      Thanks Lars, Yes that is the example i was using. I will look at the other example in there too. Maybe i can find the answer. Thanks again


      • #4
        This is an example of the template. The field circled is the control object that controls the color in the scene. So if the user clicks on Color 1 they can send the color value to that control object. But if they multi-select, all the items chosen will also get the same color. I am trying to just use the 1 control object to send the color. Its tricky since it would need to loop through each item chosen and send the color to the control object name. It would also need to change the control object name before it sends the color. Not sure if its possible but trying to find a solution.

        For the green area on the right, i was trying to see if i could get the control object name to feed from this area, not working though.


        • #5
          its easier to make materials and just give there name to select image_2021-04-29_205315.png
          TWImageInf1.PicFilename = meterial path and name
          TWImageInf1 .ThumbFilename = meterial path and name
          Last edited by mahmood2; 04-29-2021, 07:01 PM.


          • #6
            Yes, we have that as well but the client wanted to give them the option to pick any color they wanted.


            • #7
              @mlynarik.jozef do you have any ideas here?


              • #8
                Maybe consider one of these options:
                1. have a color picker assigned to let say a panel with a checkbox or a speed button saying "Assign"
                while the "assign" is active, every county you click on gets that color
                2. create another listbox you can group items in (fx, double click on item in the main list will copy it to the group list)
                then you can assign a color to all the objects in the group. you can also keep track of the groups and allow the user to re-color them if needed, if you have many items you should of course add option to remove item from a group.
                here is a simple mok up

                how do you mage the scene side, do you send a list of nodes and one color?


                • #9
                  Here is an example for possible solution.
                  the scene is a grid of rectangles
                  in the template you can chose as many rectangles as you wish and give them color through a color picker
                  eventually, you construct a string that holds container names and color values.
                  on the scene side this text is splitted and each container is then colored according to the selected color in the template.



                  • #10
                    Thanks adishin. I like both ideas. Thanks for the suggestions. I never thought about it that way and seeing it really helped. Thanks again.