论坛

由用户创建的信息 tfabini
28 January 2017 16:42
Hi Evgeny and AtttilaVM,

thank you both for posting your replies. @AtttilaVM - thank you for your findings and your fix.

Since the schedule for the project was crazy tight I wasn't able to post earlier.
I guess Evgeny is right concerning the selection of empties and I was initially wrong:

After I put together a quick test Scene with a few anchors (of type 'custom element') I noticed that m_scenes.pick_object(x, y) wouldn't hit them no matter how hard I tried.
But the moment I've attached the html elements to the anchors m_scenes.pick_object(x, y) returned the empties when the html anchors where hit. Since I can control the html elements and their properties this finding solved my problem.

Since apparently many people seem to struggle with hiding anchors - this is the approach I have used:

Setting css visibility: hidden doesn't really hide the html anchor, it still can block other objects, while css display: none; led to some problems with the positioning (at least in my setup they where jumping into location on first camera move).

So I ended up having anchors temporary hidden with: visibility: hidden, and completely disabled by setting the dimensions to zero - so they would not take up any screen space and couldn't be clicked or would not cover other objects. In the end this did the trick.


<style>
.label {
width: 40px;
height: 40px;
border-radius: 20px;
background: #ffa500;
}

.label.closed { visibility: hidden; }
.label.hidden { width: 0; height: 0; padding: 0; margin: 0; }
</style>

<script>
// jQuery approach

function hideLabels() {
$(".label").each( function (i, elem) {
$(elem).addClass("hidden");
});
}
</script>


Thomas.
22 January 2017 19:42
Hi,

In my setup I have empties (anchors) parented to objects.

When trying to select a specific object with m_scenes.pick_object(x, y); in a mouseup event listener the empties seem to get in the way, preventing most of the time clicks which should hit the object.

Since object properties in blender for an empty / or anchor don't include the section "Selection and Outlining" I've run out of options trying to get around this problem. Is it a desired behavior that empties get selected when by m_scenes.pick_object(x, y); ?

I tried to animate the empties out of the way with m_transform.set_translation(obj, x, y, z); but this way they are losing the parenting and the anchors won't stick to their specific objects later on.

Since the project is on a really tight schedule I haven't been able to assemble an example, if required I can try to put one together a.s.a.p.

I hope you can point me a solution to this problem.

Thanks,
Thomas

P.S. The current project is build on Blend4Web 16.10. Since most of the coding was done with this library, I avoided to upgrade to the latest version. If there are some changes concerning this problem in 16.12.1 I could try to upgrade the application.
16 December 2016 18:48
Hi Roman,

I've ended up choosing an approach where all required data is loaded at the beginning. After checking out larger example scenes from the SDK I've realized this was possible and even might be beneficial. (Regarding the total of data to load and smooth transitions). This is why I stopped researching on the loading side and built up a more complex scene with linked assets and all required animations.

Nevertheless, this decision was based on usability reasons not technical ones. I'm really glad you keep adding such great features and fixing issues. I'm still amazed by the performance and features of blend4web. It's a great tool.

I'll be on vacation for some weeks, out of office, but I'll still be watching closely what you guys are up to, in the meantime.

Kind regards,
Thomas
02 December 2016 19:11
Hi Roman,

Thank you for your feedback on those issues and for keeping me posted.

Have a nice weekend (again ),

Thomas
02 December 2016 14:55
Hi Roman,

thanks for solving the NLA / loading issue in 16.11.
Today i tested my current project with the new version and ran into some texture-related issues, which I was able to reproduce in a test file.

Maybe you can help sort these problems out:
When loading the second object, a viewport-sized texture is displayed instead of the object ( see attached file) and some texture-related WebGL errors appear in the console. Tested in FF48.

Some other thing driving me crazy lately (which occures in 16.10, too ) is about some WebGL Errors Firefox is displaying:

Error: WebGL: texImage2D: Uploading ArrayBuffers with FLIP_Y or PREMULTIPLY_ALPHA is slow.
b4w.min.js (row 577, column 124) - and - (row 578, column 496)

Is there something I am doing wrong with the type of textures / settings for textures I'm using?

Thank you for your support,
Thomas
18 November 2016 18:43
Hi Roman,

thank you very much for your fast reply - you answered also the question I forgot to ask - if I can safely ignore the error message without running into problems. I'm looking also forward to the upcoming release.

Thanks again,
have a nice weekend,
Thomas
18 November 2016 15:29
Hi,

following the discussions and examples on loading / unloading objects on the forum I did some tests for our application until I encountered this error:
B4W ERROR: Unsupported object: "Armature_1" or animation uuid: "04b2863eea3de92bbca079a2dfc7758f"

I'm using objects with a simple rig, animated with NLA. As soon as more than one NLA strip is used for the rig the error appears when unloading this scene and loading a new one. (Like the animation from the first rig didn't unload).

Allthough the error appears, the animations still run as intended. Am I doing something wrong (or at least something that blend4web wasn't intended for) or is this maybe a bug?

Please see the attached example.

One second thing:
I noticed that the list of loaded objects gets one more "%meta_world%World" with each load / unload. Is this the expected behavior?

Thank you,
Thomas