由用户创建的信息 E21
02 March 2017 19:59
02 March 2017 12:16
I'm trying to make a Python script in Blender that, given a number of selected objects, select objects that I want to add shadows to and adds receiving and casting shadows.
Unfortunately, it doesn't work and I don't know see what's wrong. It results in only the last selected object to be added shadow settings. What's strange is that I have a working script, similar, and export FBX for each object: here I only changed B4W related lines.
Does anyone see the error? Some help would be appreciated!
My script:
import bpy
import os
for objectN in bpy.context.selected_objects:
bpy.ops.object.select_all(action='DESELECT')
objectN.select = True
bpy.context.object.b4w_shadow_cast = True
bpy.context.object.b4w_shadow_receive = True
Unfortunately, it doesn't work and I don't know see what's wrong. It results in only the last selected object to be added shadow settings. What's strange is that I have a working script, similar, and export FBX for each object: here I only changed B4W related lines.
Does anyone see the error? Some help would be appreciated!
My script:
import bpy
import os
for objectN in bpy.context.selected_objects:
bpy.ops.object.select_all(action='DESELECT')
objectN.select = True
bpy.context.object.b4w_shadow_cast = True
bpy.context.object.b4w_shadow_receive = True
01 March 2017 19:16
22 February 2017 14:09
21 February 2017 16:00
Thank you, but somehow it's not making it for me. I'm probably making something wrong.
In the function load_cb(data_id) {} I added the whole function as: (after "// place your code here")
function load_cb(data_id) {
m_app.enable_camera_controls({
disable_default_pivot: false,
disable_letter_controls: false,
disable_zoom: false,
element: "main_canvas_container", // div container id
allow_element_exit: true
});
}
I also added m_app.enable_camera_controls({ allow_element_exit : true }) below the var m_app = require("app"); but at best I can't keep rotating the object once outside the canvas, at worst, it disables all interaction.
I would really appreciate a helpful hand.
In the function load_cb(data_id) {} I added the whole function as: (after "// place your code here")
function load_cb(data_id) {
m_app.enable_camera_controls({
disable_default_pivot: false,
disable_letter_controls: false,
disable_zoom: false,
element: "main_canvas_container", // div container id
allow_element_exit: true
});
}
I also added m_app.enable_camera_controls({ allow_element_exit : true }) below the var m_app = require("app"); but at best I can't keep rotating the object once outside the canvas, at worst, it disables all interaction.
I would really appreciate a helpful hand.
21 February 2017 09:54
Hello,
In the case when the canvas doesn't occupy the entier page, when you click inside the canvas and drag inside the canvas, you can interact with the 3D objects. However, as soon as the mouse is outside the canvas, the interaction stops. I think this is no very good for UX.
Is it possible to continue the interaction when the mouse is outside of the canvas? How can I do it?
BTW, B4W is really a nice piece of software, made with care. Congrats! You guys rock!
In the case when the canvas doesn't occupy the entier page, when you click inside the canvas and drag inside the canvas, you can interact with the 3D objects. However, as soon as the mouse is outside the canvas, the interaction stops. I think this is no very good for UX.
Is it possible to continue the interaction when the mouse is outside of the canvas? How can I do it?
BTW, B4W is really a nice piece of software, made with care. Congrats! You guys rock!
17 February 2017 11:40
Hello B4W Team!
I have a 53MB scene without textures and I'm wondering if there's a way to lazy-load assets.
Loading screens are good but it would better if I could have a short loading screen to load first elements and displays to the user. The shorter the user wait, the better. Then add more details with time. Streaming.
I think you talk about it during last conference but I can't find tutorials/docs about that. Via programing or via Blender nodes. Is it possible to do that? How?
I have a 53MB scene without textures and I'm wondering if there's a way to lazy-load assets.
Loading screens are good but it would better if I could have a short loading screen to load first elements and displays to the user. The shorter the user wait, the better. Then add more details with time. Streaming.
I think you talk about it during last conference but I can't find tutorials/docs about that. Via programing or via Blender nodes. Is it possible to do that? How?