Форум

Сообщения, созданные пользователем jeanpierre3d
22 февраля 2017 11:32
is it a bug or not?
i have a cube ( x , y, z) that i want to animate along y axe
so i create an animation with juste a single keyframe on y
i play the animation on blender everything is ok
i export json i play the animation it works but the z is not the god one my cube is higher than on blender
and then i use 3 keyframes ( x,y,z) and not only y keyframe on blender and json everything is ok

so is it normal that i have to use 3 keyframe and note only one or it s a bug?
19 февраля 2017 15:07
oh sorry i have found
get to use
m_mat.set_nodemat_rgb(textJoyeuxNoel, ["Text.000", "RGB"], 0.1, 1, 0);
19 февраля 2017 14:54
ok here is my new probleme
i want to change the diffuse color of my object material
if i use a simple material it work with

m_mat.set_diffuse_color(myObject,"Material.000", m_rgba.from_values(0.0, 0.0, 0.0, 1.0));
// m_mat.set_emit_factor(myObject, "Material.000", 10)

but i f i use a node Material.000 & Node Material.000 well it does'nt work no more

so how can i proceed?
18 февраля 2017 15:21
ok i have solve my probleme

1/i export with apply default animation

2/in the javascript i stop the animation as soon it s loaded

m_anim.set_behavior(textJoyeuxNoel,m_anim.AB_FINISH_STOP,0);m_anim.set_behavior(textJoyeuxNoel,m_anim.AB_FINISH_STOP,1);

m_anim.stop(textJoyeuxNoel,0);console.log(m_anim.get_slot_num_by_anim(textJoyeuxNoel,"Text.hide") );

m_anim.stop(textJoyeuxNoel,1);console.log(m_anim.get_slot_num_by_anim(textJoyeuxNoel,"Shader NodetreeAction.003") );

3/when i need to animate
m_anim.set_first_frame(textJoyeuxNoel,1);m_anim.play(textJoyeuxNoel,null,1);
m_anim.set_first_frame(textJoyeuxNoel,0);m_anim.play(textJoyeuxNoel,callbackfunction,0);

i forget the null in anim.play and it does'nt work if you forget it ( m_anim.play(textJoyeuxNoel,0);)
fot the callback function the probleme comes from my first frame was 0 and it has to be 1

one problem solve i can go to the next problem now
18 февраля 2017 12:37
if i use
m_anim.apply_to_first_empty_slot(myCube, "Shader NodetreeAction");
i get error message
B4W ERROR: Unsupported object: "Cube.000" or animation name: "1"

and il also encountered the probleme with animation call back
m_anim.play(mycube,callbackfunction(textActif));

function callbackfunction(textActif){console.log("function textVisible");
console.log(m_anim.get_frame(textActif));
}
it show 1 so the callbackfunction is thrown at the begining of the animation not at the end
17 февраля 2017 21:51
well i have read tutorial try a lot of thinks ……………
i have an object ( let say a cube) i want to animate move along y and at the same time make it disappear (use a value input in node tree to control alpha)
alright it works with fastpreview ( i check apply default animation)
if i open animation tab in fastpreview i see
object:myCube
animation slot:0 object 1 material
animation: cube.move shader NodetreeAction

but if i want to control it via javascript ( apply defaut animation unchecked) i can t have the both
whever i can move the cube whever i can make it disappear but not the two in same time
my script is

m_anim.apply(myCube, "Cube.move");
//i have tried with m_anim.apply(myCube, "Cube.move",0);

m_anim.apply(myCube, "Shader NodetreeAction");
m_anim.set_behavior(myCube,m_anim.AB_FINISH_STOP);
m_anim.play(myCube);


suppose there is something i don t understand but that?
and if it works with fastpreview suppose it can work with javascript control
ps if i do
m_anim.apply(myCube, "Shader NodetreeAction",1); ok my cube disappears but it don t move no more

so how can i make my cube move and disappears with javascript controling animation
08 февраля 2017 18:45
thanks roman
04 февраля 2017 15:48
i create 1 speaker with sound 1 and speaker 2 with sound 2
i play them automaticaly and i mute them

normally if i do m_sfx.mute(null,false); it must unmuted them both but it does'nt work

i am obliged to do
var m_speaker = m_sfx.get_speaker_objects();
m_sfx.mute(m_speaker[0], false);m_sfx.mute(m_speaker[1], false); to unmute them
and the m_sfx.mute(null,true); works good

if i do m_sfx.set_volume(null,10); ok it work perfect fot volume set

why mute(null,..) does'nt work?
or i do somethink wrong but can see it
26 января 2017 16:40
25 января 2017 16:00
hello everybody
so i create a scene with just a cube and a speaker in the project manager
i export it
i use a index.html with iframe
<iframe allowfullscreen src="webplayer.html?load=mybutton.json" width="800" height="500"></iframe>
i create a new button in the webplayer.html and in the webplayer.css

i create a code with a
sound_change_button.addEventListener("mousedown", button_changesound_click, false);

function button_changesound_click(e) {console.log("clicclic");}

ok it works until here
i place in my script
var m_scs = b4w.require("scenes");// console.log(m_scs);
var m_sfx = b4w.require("sfx");

but when i do
var spk = m_sfx.get_object_by_name("Speaker");
or
var spk = b4w.module.sfx.get_object_by_name("Speaker");

i get in my firefox consol
TypeError: m_sfx.get_object_by_name is not a function
or
TypeError: h is not a function

well there is something i do wrong but that?