Форум

Сообщения, созданные пользователем ktk
09 марта 2017 19:52
ktk
just wanted to share this post: https://www.blend4web.com/en/forums/topic/3118/ it's more or less about to go the other way round - controlling 3D space from 2D space.
09 марта 2017 19:48
ktk
this can bring a really cool 2D - 3D bidirectional workflow in general! i'm really looking forward to test b4w more intensely.
this was about controlling stuff from outside of the 3d canvas - the other way round is featured in this post:
https://www.blend4web.com/en/forums/topic/3076/

have fun!
09 марта 2017 19:41
ktk
@roman
feature request:
actually it would be nice to have a link like 'show in finder' directly in the project manager - that would avoid most of that stuff

09 марта 2017 19:38
ktk
Hi Roman

Thank you for explaining this!

So just drop your media files in your project's assets folder and everything is fine!

That's so easy with b4w - You guys do a great job!

09 марта 2017 15:06
ktk
just in case my entire log

09 марта 2017 15:04
ktk
hello roman

oh the sound file doesn't seem to be exported/included in the .json file



yes 'btn' has 'selectable' enabled

do i have to set asset paths (sound/video,etc.) manually? and if so : where?
09 марта 2017 14:57
ktk
ahhh … thx a lot v3ny!

my final solution below & the scene name is definitely the name of the Scene in Blender not the .json or .blend name, i was just confused about that.



function load_cb(data_id, success) {

    if (!success) {
        console.log("b4w load failure");
        return;
    }

    m_app.enable_camera_controls();

    // place your code here
    
    document.getElementById("camBtn").onclick = function() {resetCamera()};

}
    
function resetCamera() {    
    m_logic_n.run_entrypoint("Scene", "camera");
    console.log("Camera is resetting");
}
09 марта 2017 01:01
ktk
i made a simple sound test - hit the button cubes spins sound plays …
everything works fine in blender fast preview

starting the project from the project manager or publishing it to a server : the sound doesn't play..

help?


08 марта 2017 21:02
ktk
any help on this?
08 марта 2017 20:47
ktk
according to https://www.blend4web.com/api_doc/module-logic_nodes.html#.run_entrypoint

i did :

a) include logic nodes

var m_logic_n   = require("logic_nodes");


b) write my function to be called from html

function resetCamera() {
    m_logic_n.run_entrypoint(Scene, ResetCamera);
}


node name is clear but i'm not sure about the scene name - is this the name of my blender file, like
abc.blend then it would be 'abc' otherwise a Scene is called Scene….


c) call my function from html
<div class="btn"><a onClick="resetCamera()">Reset Cam</a></div>


DOESN'T WORK! ;(