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.

Save Normal Map with send data puzzle

Home Forums Puzzles Save Normal Map with send data puzzle

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #19873
    hoody
    Participant

    Hey Guys. How can i store the normal maps generated from “texture from text”-puzzle on my server?

    Currently im using sendData puzzle to store the texture + the normal map generated from it on my server.
    It works with the texture from text, but not for the nomal maps that are generated for this texture.

    The uploaded json. data is always only 2bytes small. (its empty).

    Here is my code and my puzzle in the attachments:

    eventHTMLElem(‘click’, ‘changer’, true, function(event) {
    replaceTexture(‘mat_schnalle_links’, ‘NORMALHOODOR.png’, generateNormalMap(textureFromText(getHTMLElemAttribute(‘value’, ‘picker5’, true), 2860, 1445, ‘Clear Sans Medium’, getHTMLElemAttribute(‘value’, ‘picker6’, true), ‘LEFT’, getHTMLElemAttribute(‘value’, ‘picker7’, true)), 10, 10, 0, ‘Sobel’, false, false, true), function() {});
    replaceTexture(‘mat_schnalle_rechts’, ‘NORMALHOODOR.png’, generateNormalMap(textureFromText(getHTMLElemAttribute(‘value’, ‘picker5’, true), 2860, 1445, ‘Clear Sans Medium’, getHTMLElemAttribute(‘value’, ‘picker6’, true), ‘LEFT’, getHTMLElemAttribute(‘value’, ‘picker7’, true)), 10, 10, 0, ‘Sobel’, false, false, true), function() {});
    sendData(generateNormalMap(textureFromText(getHTMLElemAttribute(‘value’, ‘picker5’, true), 2860, 1445, ‘Clear Sans Medium’, getHTMLElemAttribute(‘value’, ‘picker6’, true), ‘LEFT’, getHTMLElemAttribute(‘value’, ‘picker7’, true)), 10, 10, 0, ‘Sobel’, false, false, true), ‘http://brudastan.de/wp-json/verge3d/v1/upload_file/’, function() {
    saved_conf_url = setUrlParam(getUrlData(‘URL’), ‘normal_url’, dictGet(_pGlob.loadedFile, ‘link’));
    openWebPage(saved_conf_url, ‘NO_RELOAD’);
    });
    });

    I hope you guys can help me once again.

    Thanks

    #19881

    Hi,

    the normal map puzzle works asynchronously. Under the hood, it waits until a normal map is created and only after that the replace texture operation is invoked.
    You can use a timeout puzzle with a small time to work around this.

    Chief 3D Verger | LinkedIn | Twitter

    #19886
    hoody
    Participant

    Hi yuri. Im not sure where to put the timeout puzzle.

    My Problem is not that the replace texture puzzle does not work on custom url.

    My problem ist that the texture replacement happens with an empty file for the generated normal map (2bytes).

    The texture from text is uploaded to the server without any problems but the files for the normal maps are just empty. So i suppose it has to do sth with the send data puzzle, but i cant figure it out.

    #19904

    Hi,

    Try the following workaround:

    Attachments:
    You must be logged in to view attached files.

    Chief 3D Verger | LinkedIn | Twitter

    #19911
    hoody
    Participant

    Hey Yuri. thanks for the answer.

    I updated to the latest version and tried your puzzle, but the result is the same – the uploaded data is only 2 bytes small.

    #19917
    hoody
    Participant

    I noticed that it does not matter if a normal map is uploaded. It seems to work alone with the texture from text. But it bevahes very strange.

    Maybe you can take a look at this example:

    http://brudastan.de/wp-content/uploads/verge3d/2532/Brudi.html?image_url=http://brudastan.de/wp-json/verge3d/v1/get_file/1570451957&normal_url=http://brudastan.de/wp-json/verge3d/v1/get_file/1570451957

    You have to refresh the Link 5-6 times: at one moment the normal map will display correctly. But when you refresh the page again the normal is gone.sometimes its there and sometimes not (under the same cusom link)

    I attached two screenshots, so that you can see the difference

    #19930

    Hmm… Can you make the timeout bigger just to make sure, say 3 seconds instead of 0.1?

    Chief 3D Verger | LinkedIn | Twitter

    #19935
    hoody
    Participant

    Hey. I tried that (tried with 0.1 ; 0,5 and 3 s) but it does not seem to make a difference.

    #19940
    hoody
    Participant

    I think i found the problem.

    Ill post my solutuion later this day.

    :)

    #19942

    :yahoo:

    Chief 3D Verger | LinkedIn | Twitter

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