Форум

Сообщения, созданные пользователем LukeVideo
07 июня 2016 10:22
Maybe your gonna need a JScallback node.

https://www.youtube.com/watch?v=dWEHg5Yzcys

This video is very instructive.
I used it to display divs in front of the canvas when i click on some objects.
03 июня 2016 16:16
I wonder if the resource could possibly be a IFRAME ?
That would be cool.
02 июня 2016 13:16
Thanks a lot!

I am not very used to reading API and technical documentation so i tend to need a little extra explanation to be sure about what i do. With time i should get better at it.

Luke.
02 июня 2016 13:08
You bet that was helpfull!
so i found that i works best by using the logic nodes module and this custom call
var m_logic_nodes= require("logic_nodes")

/**
* callback executed when the app is initialized
*/
function init_cb(canvas_elem, success) {

if (!success) {
console.log("b4w init failure");
return;
}
m_logic_nodes.append_custom_callback("cubeClick", cubeClick);
load();
}

/**
* load the scene data
*/
function load() {
m_data.load("LukeVideoLowPoly.json", load_cb);
}
function cubeClick(){

var vignette = document.getElementById('head');
console.log(vignette);
if (vignette.style.visibility === "visible"){
vignette.style.visibility = "hidden";
}
else {
vignette.style.visibility = "visible";
}

}

You will notice this is very primitive ! Yet it works !

Having great fun!

I was wondering how i could get Jquery call in function i call like that. I think i particular of the classtoggle i try to call on some DIV i position on top of the canvas? Maybe i should consider making my own module?

Have a great day !
01 июня 2016 18:30
Yeah of course! I hadn't realized they was a Logic_nodes module. My fault…
Thank you so much !
01 июня 2016 17:44
Hello.
I'm trying to use the JSCalback node but i am not sure how to use it.

I tried using the ID in a manifold, the function name the function name with parentheses. None of it works. In the documentation i didn't find what the callback Id is.
here is the code i'm trying to triger

 
setup_direction();

function setup_direction(){
var head = m_scenes.get_object_by_name("CubeHeadLeft");
console.log(head)
var key_up = m_ctl.create_keyboard_sensor(m_ctl.KEY_T);
var key_down = m_ctl.create_keyboard_sensor(m_ctl.KEY_G);
var key_right = m_ctl.create_keyboard_sensor(m_ctl.KEY_H);
var key_left = m_ctl.create_keyboard_sensor(m_ctl.KEY_F);

var direction_array = [
key_up, key_down, key_right, key_left
];

var up_logic = function(s){return (s[0])};
var down_logic = function(s){return (s[1])};
var right_logic = function(s){return (s[2])};
var left_logic = function(s){return (s[3])};

function moveHead_cb(obj, id, pulse){

if (pulse == 1){
console.log(obj);
var head_pos = m_trans.get_translation(obj);
console.log(head_pos);
head_pos[0]+=1
console.log(head_pos);
m_trans.set_translation(obj, head_pos[0], head_pos[1], head_pos[2]);
}
else{
console.log("no pulse");;
}
};

m_ctl.create_sensor_manifold(head, "UP", m_ctl.CT_TRIGGER,
direction_array, up_logic, moveHead_cb);
}


Should i change this code to call movehead_cb?? What should i put in the node.

01 июня 2016 13:30
I guess the furniture tutorial is quick good for that. Maybe you can adapt some behaviors form that scene to your taste. Like the collision sensor could be used to check if an object has been dropped in the right place.
01 июня 2016 12:43
Ok did a little search for Nvidia tools Blend4web and found this on GitHub
  missing_progs = get_missing_progs(dependencies)
if "ffmpeg" in missing_progs and not "avconv" in missing_progs:
index = missing_progs.index("ffmpeg")
del missing_progs[index]
if "avconv" in missing_progs and not "ffmpeg" in missing_progs:
index = missing_progs.index("avconv")
del missing_progs[index]
needed_progs = {}
for dep in missing_progs:
if dep == "avconv" or dep == "ffmpeg":
needed_progs["Libav or FFmpeg"] = True
elif dep == "identify" or dep == "convert":
needed_progs["ImageMagick"] = True
elif dep == "nvcompress":
needed_progs["NVIDIA Texture Tools"] = True
elif dep == "qt-faststart":
needed_progs["Qt-faststart (optional)"] = True
for prog in needed_progs:
print("Couldn't find", prog)
if len(missing_progs) > 0:
return False


One will notice that other libraries are tried first for example imagemagick. So i installed it and it WORKS AGAIN !


That's another one to look for one fresh instals…

Have a great day.

Luke
01 июня 2016 12:27
I get this error when in try to check if the project i just created works.
Couldn't find NVIDIA Texture Tools
Processing directory: apps_dev/lukeVideoLowPoly
Resizing textures
Compressing textures
Traceback (most recent call last):
File "/home/lukevideo/Blender/sdkMay/blend4web_sdk_free/apps_dev/project.py", line 44, in
project_cli.run(sys.argv, base_dir)
File "/home/lukevideo/Blender/sdkMay/blend4web_sdk_free/scripts/lib/project_cli.py", line 197, in run
run_convert_resources(args[1:], proj_path)
File "/home/lukevideo/Blender/sdkMay/blend4web_sdk_free/scripts/lib/project_cli.py", line 1655, in run_convert_resources
subprocess.check_call([python_path, conv_path, "-d", assets_dir, "convert_dds"])
File "/home/lukevideo/Blender/blender-2.77a-linux-glibc211-x86_64/2.77/python/lib/python3.5/subprocess.py", line 584, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/lukevideo/Blender/blender-2.77a-linux-glibc211-x86_64/2.77/python/bin/python3.5m', '/home/lukevideo/Blender/sdkMay/blend4web_sdk_free/scripts/converter.py', '-d', '/home/lukevideo/Blender/sdkMay/blend4web_sdk_free/apps_dev/lukeVideoLowPoly', 'convert_dds']' returned non-zero exit status 1


I run on the onboard intel chip quite happily on my laptop.
01 июня 2016 11:18
Hello all.
I'm back into blend4web! It's been a while… It's good to bee back.
I am building a simple portfolio around of model of myself. The idea is that i have a model of me on wich you can click. Depending on where you click a <div> opens with information about me or examples of my work.
So i'm starting the project and looking in the project manager i realized i could choose the engine. I wonder witch on would be best for a full screen experience of that kind. I also wonder whet update means. I will leave the default for now but i would love more information on that topic.

Best regards.

Luke