由用户创建的信息 LukeVideo
17 November 2017 00:41
Hy,
I haven't used B4W in a while. I am trying a simple function in nodes. But the problem seems to be my ability too use transform object node.
I try to use R1 to change the location of the cube when clicking the sphere. Or i didn't use the math operation right but i see the in the logs that R1 increase but the cube doesn't move….
Could someone be so kind as to take a look at my file please.
Regard,
Luke.
I haven't used B4W in a while. I am trying a simple function in nodes. But the problem seems to be my ability too use transform object node.
I try to use R1 to change the location of the cube when clicking the sphere. Or i didn't use the math operation right but i see the in the logs that R1 increase but the cube doesn't move….
Could someone be so kind as to take a look at my file please.
Regard,
Luke.
30 August 2017 11:12
Hy I have put these few lines of code together to do individual exports of every object in a scene.
DO NOT USE IN PROJECT FILE !!!!!
USE IN EMPTY FILE NEXT TO THE PROJECT FILE . If you don't understand what's going on don't use this, Thank you!
It imports exports and deletes, one after the other every object in a given blend file. It does the exports but you end up with a empty file.
But i find it useful because i had to link every object in a new file for each object and then go from one file to the other to do all the updates. I ended up with this solution because of the scope of the blender scripts. If you open a file you lose track of your script…
I have one file where i model all objects i need for my b4w app and when i'm done i open a new file with the script and it does all the exports for me and i get all the .json and .bin files i need to load in the project.
If you want to have a look, if you see any optimisation that could be done, let me know. Next thing is going to do a folder for each object group and export every object in a group in a separate folder. A matter of more for in…
DO NOT USE IN PROJECT FILE !!!!!
USE IN EMPTY FILE NEXT TO THE PROJECT FILE . If you don't understand what's going on don't use this, Thank you!
It imports exports and deletes, one after the other every object in a given blend file. It does the exports but you end up with a empty file.
But i find it useful because i had to link every object in a new file for each object and then go from one file to the other to do all the updates. I ended up with this solution because of the scope of the blender scripts. If you open a file you lose track of your script…
I have one file where i model all objects i need for my b4w app and when i'm done i open a new file with the script and it does all the exports for me and i get all the .json and .bin files i need to load in the project.
If you want to have a look, if you see any optimisation that could be done, let me know. Next thing is going to do a folder for each object group and export every object in a group in a separate folder. A matter of more for in…
import bpy
#create list to get all objects in external source file
sourceList = []
# path to the source file
filepath = "//source.blend"
# build a list of objects in the source file by loading data from it
with bpy.data.libraries.load(filepath) as (data_from, data_to):
data_to.objects = data_from.objects
# now append each object name to the sourceList
for object in data_to.objects:
if object is not None:
sourceList.append(object.name)
print(sourceList)
#UNLOAD DATA ! Else name get suffixes.001 .002 AND we have to re-import every object ONE AT A TIME to export them ONE BY ONE.
for o in bpy.data.objects:
o.select = True
bpy.ops.object.delete()
for mesh in bpy.data.meshes:
bpy.data.meshes.remove(mesh, do_unlink=True)
#now that we have a list lest iterate over it to import, exprort and delete every object
for object_name in sourceList:
#Append object to current scene
blendfile = '/home/user/blenderProject/source.blend'
section = '/Object'
directory = blendfile + section
bpy.ops.wm.append(filename=object_name, directory=directory)
#Add object to the list to later erase mesh from memory
meshes_to_remove = []
for ob in bpy.context.selected_objects:
meshes_to_remove.append(ob.data)
#Do the export
bpy.ops.export_scene.b4w_json(filepath="/home/lukevideo/blenders/scripting/"+object_name+".json")
# delete the object
bpy.ops.object.delete()
# Remove the meshes from memory too
for mesh in bpy.data.meshes:
bpy.data.meshes.remove(mesh, do_unlink=True)
print(meshes_to_remove)
print(bpy.data.meshes)
25 August 2017 19:56
25 August 2017 12:06
Hy, thanks.
That's what i'm using. Only i use the basic app.js file and something has to be messing with the canvas CSS and i wonder if that could be changed. The top:0 and left:0 position:absolute are kind of breaking my styling. Nothing i can't fix with loads of important tags. But that isn't a tag you should use, right.
That's what i'm using. Only i use the basic app.js file and something has to be messing with the canvas CSS and i wonder if that could be changed. The top:0 and left:0 position:absolute are kind of breaking my styling. Nothing i can't fix with loads of important tags. But that isn't a tag you should use, right.
24 August 2017 17:17
24 August 2017 17:16
24 August 2017 17:13
23 August 2017 18:26
Oh My GOD !!
Thank you so much! I am glad that's not a bug ! But i just couldn't figure out what else !
I have never heard of that var = i syntax and i would never have thought of it… I will try to remember that!
B4W is a bit tricky.
How could i get more debug info from B4W because it just crashed and that was it.
Thank you so much! I am glad that's not a bug ! But i just couldn't figure out what else !
I have never heard of that var = i syntax and i would never have thought of it… I will try to remember that!
B4W is a bit tricky.
How could i get more debug info from B4W because it just crashed and that was it.
23 August 2017 13:21