Tagged: blender, disappearing object, morph factor, puzzles, shape keys
- This topic has 6 replies, 2 voices, and was last updated 2 years, 1 month ago by natecaspar.
-
AuthorPosts
-
2022-10-02 at 5:52 pm #56307natecasparParticipant
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.2022-10-02 at 6:25 pm #56311kdvParticipantprint to console VARS after receiving a message and show
changeit
function.Puzzles and JS coding. 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 the meaning at all.
2022-10-02 at 8:46 pm #56314natecasparParticipantHere’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.2022-10-02 at 8:52 pm #56317kdvParticipantID = [object Object]
doesn’t bother you?Puzzles and JS coding. 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 the meaning at all.
2022-10-02 at 9:14 pm #56320natecasparParticipantThanks 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…
2022-10-02 at 9:44 pm #56322kdvParticipantThe 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.
Puzzles and JS coding. 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 the meaning at all.
2022-10-02 at 10:47 pm #56326natecasparParticipantMakes sense. I was able to get it to work with your input! thanks so much!
-
AuthorPosts
- You must be logged in to reply to this topic.