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.

Object Disappearing when Set Morph Factor…

Home Forums Puzzles Object Disappearing when Set Morph Factor…

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #56307
    natecaspar
    Participant

    Hi there!

    I am creating an application that uses shape keys and set morph factor to manipulate a simple 3d model. I am sending data to the verge 3d iframe via postMessage.

    The input fields in the parent document have an “input” eventlistener, so any time the input is changed, the data is sent to the iframe. The data is sent via JSON (stringify) and then parsed once it is received in the iframe.

    My puzzle listens for a message event, and then sets VARS[”] for each of the 3 shape keys, then calls a protocol which sets the morph factors to the created variables.

    The problem is, whenever I change the input, my object disappears and I can’t figure out why.

    At one point I had it working, so I know it is possible but I can’t figure out why it no longer functions!

    Any help would be greatly appreciated! Thank you.
    I attached the code that sends the data to the iframe, as well as the code in my puzzle.

    Attachments:
    You must be logged in to view attached files.
    #56311
    kdv77kdv
    Participant

    print to console VARS after receiving a message and show changeit function.

    #56314
    natecaspar
    Participant

    Here’s a screenshot of the full puzzle with the changeit procedure.

    I know that the data is being received and properly parsed, as I can log each VARS upon being received by the iframe. Here’s a screenshot of the VARS being logged.

    Thanks!

    Attachments:
    You must be logged in to view attached files.
    #56317
    kdv77kdv
    Participant

    ID = [object Object] doesn’t bother you?


    https://v3d.net/bdd

    #56320
    natecaspar
    Participant

    Thanks so much for the help! I’ll try to implement that now. Not sure why the ID = [object Object] is returned as well as the VARS value…

    #56322
    kdv77kdv
    Participant

    The point is that a morph factor must be a numeric value. If an input value cannot be converted into a number it will kill your model.

    #56326
    natecaspar
    Participant

    Makes sense. I was able to get it to work with your input! thanks so much!

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