Сообщения, созданные пользователем JeremyS
15 февраля 2018 17:29
Hmm.. the code snipped works well on my computer but the blend file I attached does not. I'll try to figure out what I did differently.
I was using
Things that didn't change anything include making the object and shadow plane dynamic and making the shadow plane opaque. I'll try some other things.
Thanks for your help.
I was using
m_geom.set_shape_key_value()
and using the sliders in the blend4web viewer.Things that didn't change anything include making the object and shadow plane dynamic and making the shadow plane opaque. I'll try some other things.
Thanks for your help.
06 февраля 2018 16:23
I'm trying to get shadows to work with shape keys — to move as the shape key moves. Does anyone have any suggestions?
I've attached a gif of what happens now — the object (cube) moves but the shadow doesn't. I've also attached the file that created the gif.
One partial solution is to pre-render the shadow and scale it (programmatically) with the shape key. This works great for cylindrical objects where x and y scale evenly (the shadow looks better too). But I found out you can only scale objects uniformly — you can't scale x & y independently — so that doesn't work for objects like this cube.
Maybe I could use ambient occlusion — simply show some darkness where the cube and the shadow plane meet? I've used similar approaches in other programs, but I can't seem to get it to work with blend4web.
Any other thoughts or suggestions?
Thanks for your help.
— Jeremy
Note: I'm using OSX so I get the warning that blend4web is applying a "shadows hack". I don't know if this works differently on a PC, but I need to support OSX and iOS anyway.
I've attached a gif of what happens now — the object (cube) moves but the shadow doesn't. I've also attached the file that created the gif.
One partial solution is to pre-render the shadow and scale it (programmatically) with the shape key. This works great for cylindrical objects where x and y scale evenly (the shadow looks better too). But I found out you can only scale objects uniformly — you can't scale x & y independently — so that doesn't work for objects like this cube.
Maybe I could use ambient occlusion — simply show some darkness where the cube and the shadow plane meet? I've used similar approaches in other programs, but I can't seem to get it to work with blend4web.
Any other thoughts or suggestions?
Thanks for your help.
— Jeremy
Note: I'm using OSX so I get the warning that blend4web is applying a "shadows hack". I don't know if this works differently on a PC, but I need to support OSX and iOS anyway.
10 января 2018 17:18
I figured out how to make it work. If it helps anyone the json file has to be of the form:
It has to say ".png" or ".jpg" or whatever. But it can be a redirect to another file, which is what I did.
I suspect this has to do with blend4web accessing alternate, compressed textures. It's a bit annoying that we can't just use a simple url to access the assets since they are just basic http requests. But I managed to make it work.
– Jeremy
"filepath":"normal.png"
It has to say ".png" or ".jpg" or whatever. But it can be a redirect to another file, which is what I did.
I suspect this has to do with blend4web accessing alternate, compressed textures. It's a bit annoying that we can't just use a simple url to access the assets since they are just basic http requests. But I managed to make it work.
– Jeremy
09 января 2018 23:13
Looked a bit more into this. Turns out the filepaths in the json in the can't have a querystring – that's the thing you get at the end of some urls after the question mark – ?a=something&b=something_else.
To be honest, this is a bit frustrating. Using querystrings and http:// worked in the previous version of blend4web*. The assets are retrieved through simple http requests so I'm not sure why this isn't working.
Is there a good way around this?
Jeremy
* I did have to add a & at the end of the querystring because blend4web adds a ?v=<version> to the http requests, but this worked fine.
This works:
"filepath": "normal.png"
This doesn't:
"filepath": "normal.png?val=something&"
To be honest, this is a bit frustrating. Using querystrings and http:// worked in the previous version of blend4web*. The assets are retrieved through simple http requests so I'm not sure why this isn't working.
Is there a good way around this?
Jeremy
* I did have to add a & at the end of the querystring because blend4web adds a ?v=<version> to the http requests, but this worked fine.
08 января 2018 20:08
I'm unable to load images from Amazon's AWS S3 – a remote server. How can I get it to work?
I'm doing this by changing the json info before it gets served.
This worked in a project I did with blend4web version 16.05. And it works now (version 17.10) for the binfile. But not for the images.
The app also works now when I have relative paths (no 'https://'), where the assets are on the same server.
But with absolute paths (with 'https://', )I get this error:
Here's how the json is changed for each image (in images array):
I need to have all that stuff (the query string) after the ".png" so I can show private assets from S3. They assets need to be private because some of my clients have confidential information.
How can I get these assets to load correctly?
I'm doing this by changing the json info before it gets served.
This worked in a project I did with blend4web version 16.05. And it works now (version 17.10) for the binfile. But not for the images.
The app also works now when I have relative paths (no 'https://'), where the assets are on the same server.
But with absolute paths (with 'https://', )I get this error:
B4W ERROR: image "Normal" has unsupported format or broken path.
Here's how the json is changed for each image (in images array):
"name": "Normal",
"size": [
2048,
2048
],
"uuid": "f5fa81f0f15ecf493c7f6d3fce277bad",
"source": "FILE",
"filepath": "https://mockup3d.s3.amazonaws.com/test/can_test/can%20normal%20v2.png?AWSAccessKeyId=AKIAJOX33XW3K22K3JNA&Signature=hNUYo%2FnSX0BkWlFk1%2FnY%2Fx6mNFM%3D&Expires=1515432296&",
"colorspace_settings_name": "sRGB"
I need to have all that stuff (the query string) after the ".png" so I can show private assets from S3. They assets need to be private because some of my clients have confidential information.
How can I get these assets to load correctly?
26 октября 2017 15:31
Thanks for the quick response. And for the solution – it works!.
I had tried applying the modifier, but I hadn't switched the "apply modifiers" checkbox off. Once i did, it worked.
So in order to animate something you have to have all the modifiers applied and uncheck "apply modifiers" even if they're aren't any left. Makes sense.
I had tried applying the modifier, but I hadn't switched the "apply modifiers" checkbox off. Once i did, it worked.
So in order to animate something you have to have all the modifiers applied and uncheck "apply modifiers" even if they're aren't any left. Makes sense.
26 октября 2017 14:54
26 октября 2017 00:36
Super dumb question to start with, but I just can't seem to get this animation working.
It's a simple box with a lid opening using an armature with only 1 bone. It animates just fine in blender but won't show up at all in the viewer.
I've attached the file. What am I doing wrong?
Thanks for your help.
It's a simple box with a lid opening using an armature with only 1 bone. It animates just fine in blender but won't show up at all in the viewer.
I've attached the file. What am I doing wrong?
Thanks for your help.