We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

removing – changing when hovered event

Home Forums General Questions removing – changing when hovered event

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #61267
    Crunch
    Customer

    So if I want to change which objects have a when hovered event, I always thought I just had to create a when hovered event using a list, then later when i modified what was in the list, the when hovered event would update?

    Help please thanks

    Attachments:
    You must be logged in to view attached files.
    #61270
    Pandern
    Customer

    Don’t know why, but setting the variable to an empty list or another list doesn’t change the ovjects the hovered state is working for.

    Only removing object from the original list seem to work.

    Attachments:
    You must be logged in to view attached files.
    #61272
    kdv
    Participant

    Only removing object from the original list seem to work.

    Yeap. Removing/adding objects from/to the list will remove/add objects from/to the hover event. There is no need to register the when hovered event for every object. It’s enough to do it for a list of objects (which can be changed afterwards)

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #61275
    Crunch
    Customer

    So correction.. In my first screenshot I wasn’t actually creating a proper list as I was using the group selector for boxes and spheres group. But.. as you guys pointed out, even if I brought in a proper list of objects, I can’t just quick reset it – rather, I need to remove items one by one.

    Maybe a function that iterates thru and removes all items??
    Then probably need to have the same type of iteration to add items back?

    Before I got the feedback and did come up with a workaround, where I move all possible objects I want to be hoverable go new collection in blender. Then in the hover puzzle, items that go into the on over slot are then filtered against my list before the desired effect is applied.

    The list in this method, can be easily cleared at once, and reconstructed into list with get all objects from group puzzles.

    Any performance concerns between the two methods?

    Thank you gentlemen for the time and input!!!

    Attachments:
    You must be logged in to view attached files.
    #61277
    kdv
    Participant

    I can’t just quick reset it

    you can

    after this puzzle no objects will be triggered as hovered

    Give more details. Why do you click the sphere? What do you want to get? To remove outlines or just reset the hovered objects list? Or do you want to remove the clicked object from that list?

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #61279
    Crunch
    Customer

    “you can – after this puzzle no objects will be triggered as hovered”

    umm.. Not sure about that. Pretty sure that is how it use to work.. but now (latest 4.3 version) doesn’t seem you can just clear the list.. my testing shows that list needs to be cleared 1 item at a time via the ‘remove from list’ puzzle.

    The sphere click i used was just arbitrary to trigger the experiment i was doing.

    #61280
    kdv
    Participant

    Not sure about that

    clicked and hovered objects can be handled in lists. If those lists are empty no objects are handled.

    If it doesn’t work you can clear the current list instead of assigning a new one
    VARS.hoveredObj.splice(0);

    And yes, creating a new empty list won’t work. You need to clear the existing list…

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #61320
    Crunch
    Customer

    super helpful as always, thanks you KDV!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.