• 10Mar

    Goal: Add a keyboard toggle for the “Edit Linked Parts” checkbox in the Edit window. I’ll also probably add a menu entry for it in the Tools menu as part of that process.

    Obstacles: The preference for “Edit Linked Parts” is actually saved as the opposite of that: “SelectLinkedSet”. When the ELP checkbox is on, that means the SLS preference is off. This means there must necessarily be an extra layer of code between the checkbox and the preference, in order to do everything oppositely.

    How to accomplish the goal:

    1. Convert “SelectLinkedSet” preference to a new “EditLinkedParts” preference.
    2. Update all the code in the viewer that depends on SLS, to make them depend on ELP instead. Don’t forget to correct for the non-oppositeness.
    3. Change the “Edit Linked Parts” checkbox to use the LLUICtrlFactory to access ELP.
    4. Add a menu entry with a key binding to the Tools menu to toggle ELP.*

    * I might be able to add a key binding without adding the new menu entry, but I don’t currently know how to do that, and the menu entry is a good thing anyway.

    Rewards: The building process will be much faster and more fluid!

    Required knowledge:

    • How XUI keyboard shortcuts work. (Check!)
    • How XUI Menus work. (Check!)
    • How Preferences work. (Check!)
    • How LLUICtrlFactory works.

    Posted by Jacek Antonelli @ 4:38 pm

    Tags:

3 Responses

WP_Cloudy
  • Jacek Says:

    I’m done, except for one hiccup: when you toggle Edit Linked Parts, it’s supposed to callback a function that modifies which prims you have selected. But, I haven’t made the menu entry perform that callback when it’s run, which means that your selection doesn’t change when you use the menu entry or keyboard shortcut.

    Also, I need to think of a good keyboard shortcut for toggling Edit Linked Parts. Hmm.

  • Jacek Says:

    I solved the callback issue by creating a new listener in `indra/newview/llviewermenu.cpp’ which responds to “Tools.EditLinkedParts” from the menu, and promotes or demotes the selection accordingly. Everything works great now.

    Right now I’m using ; (semicolon) to toggle Edit Linked Parts, but I’m open to suggestions for a better keyboard shortcut. I want to keep it simple and within reach, because I switch this setting quite often while building.

  • AllieKat Stovall Says:

    grrrr lol are you doing this in the open sourced windows viewer? if so, i want a copy lol