Babylon Software Ltd

0 views
Skip to first unread message

Rosalia Kemme

unread,
Aug 3, 2024, 6:02:02 PM8/3/24
to siccucaco

Wordpress will not make this easy for you.
If you had a plain website, you just add a canvas element to the dom and a script to initialize bjs and you are off to the races. With wordpress all of your time is going to be spent figuring out workarounds to add your own custom html/js to the page. It can be done easily if you knew where to go. Just be aware that you are specifically fighting the WordPress cms, not the bjs library or web development as a whole.

Just wanted to provide my two cents -
the first line (the script) should be added to the tag. The tag should be added to where you want to show your model. Made sure you set the size of the tag, otherwise it will use its default values.

Here it is - Babylon.js 3D Wordpress Plugin
Babylon.js 3D Wordpress Plugin - forum thread
Download:
GitHub - eldinor/babylon-wordpress-plugin: Display 3D content with Wordpress using a shortcode to insert in a page or post. Supports GLTF, GLB and BABYLON files upload. Shortcode: [babylon]URL-OF-3D-FILE[/babylon]

Hope, this guide will help you but if you face any issue while adding Script in your WordPress website, then I will suggest you to choose managed WordPress hosting where you can easily configure everything on some clicks due to the managed platform. I am using Babylon on my WordPress website and I configured it through their platform.

Some of my students had this issue when using their internet connection at school which uses a proxy. All downloaded versions of the editor were damaged/corrupted and or did not have access to the website editor.babylonjs.com due to security issues (certificate etc)

After another day pf fiddling with settings, I have improved my situation, but this is still an incredible pain. The biggest breakthrough was turning off the PBR materials in the Exporter. The other thing that helped a lot was turning on only one light at a lime in Blender and Babylon and adjusting each light individually.

To answer your questions, I am not set on any particular workflow, I am happy to use anything that works smoothly. My first attempt was Sketchup exporting .stl files until I discovered that it only saves the mesh and none of the materials. Mt secord attempt was to import the .stl files into Blender, redo the materials then export as a .glb file. This works reasonably well, but creates rotated models that are a pain to work with, so I searched around and discovered a Babylon exporter plugin for Blender that supports things like setting isPickable on meshes etc, so this is what I am playing with right now.

Create additional .blend files for each model (building, vehicle, character, item etc). These files can link to your main scene.blend and reference the lights and shared materials in there. This way you develop your models for consistent lighting.

Export all of your blender models to .babylon files (on .glb if you want to squeeze out the last few bytes). This can be done using a command line script so that if you change a shared material, you can re-run all of the .blend to .babylon conversions to regenerate all of your models.

Load .babylon files into containers in Babylon so that you can easily add/remove to the scene and create multiple instances without duplicating the mesh vertexes. After loading each file, loop through all of the materials setting their ambientColor property.

I think I should be able to get around the runtime issues by implementing my own version of container.instantiateModelsToScene that hooks up the meshes to the materials that already exist in the scene rather than creating new ones.

Unfortunately the Babylon exporter for Blender does not export NLA animations at all. As an experiment I added some non-NLA animations and they are exported, but you can only have one animation per mesh if you do this and the whole model has a single timeline.

I think that what should happen in the Babylon exporter for Blend is that NLA Action Strips with the same name should be combined into a Babylon ActionGroup that can be started and stopped within Bablyon in response to game events (such as firing a weapon).

For now I will have to go back to square one and investigate another file format. I still like Blender, so I think I will do an experiment where I export a model from Blender in every supported file format, then try importing them one at a time into Babylon to see which ones have limitations that can be worked around.

What Blender requires does not matter in this case. An individual mesh / armature has an active Action, which can also be None. For each object where the active Action is not None, all actions in the scene are exported.

Babylon format only allows only one animation per object. The exporter also records the start and stop frames of each action as a BABYLON.AnimationRange with the same name as the Blender Action. This means you call up the animation by name, not frame ranges. See your log file if you want to see the actual ranges.

You can request that only the current animations be exported on the custom properties of World. You may have multiple actions in the blend, but not want any of the others be on the export without deleting them.

If you have multiple objects which have an active Action, but you which to only perform a certain action on a single object, use an objectName-actionName format for the name of the Action. e.g.: MyMesh-Jump.

Right skip #1
.
Wrong on #2. Each action should start at frame 0. It is the exporter which goes thru all the actions & makes and sequences them into the single animation for an object that the file format supports. It will actually make a 5 frame gap between, just for my own sanity.

Right, you cannot put multiple actions on a mesh, but you can make as many actions as you wish. An object only has a current action. It is the exporter, when an Object is encountered which has a current action, which goes through all the animations, setting each to be current one at a time, then running, & grabbing the result.

I made some progress. I deleted al of my action strips, and all of my actions and started over. I created 6 actions in the Blender Action Editor with different names, all between fames 0 and 30. Each animation applies to a different object/mesh.

I saved my blend file, then exported to Babylon, and all of the objects with animations rotated by about 45 degrees. No biggie, Ctrl-Z fixed that issue. I tried this several times and each time I exported the objects were rotated. So I closed Blender and re-opened it just to clean out any garbage from the deleted action strips and this time the export worked without the rotation problem, but when I loaded the model into Babylon one of the animated objects/meshes was displaced quite far from where it should be.

I found a fix for the animation speed variations. Not sur if this is the right way to fix the problem, but I took the first keyframe of each animation and Shift-D (duplicate) and moved it to keyframe 0, then took the last keyframe and Shift-D move to last keyframe, so that all of the animations are the same length and have the same start and end frame in Blender.
When I export it like this, the animation ranges in Babylon are now correct and all the animations run at the correct speed.

More progress and more snags. My current road block is that AnimationGroup does not seem to support AnimationRange, and the Blender Babylon exporter packs all of the Blender actions into one animation with different frame ranges. This makes the AnimationGroup unusable in this workflow.

To use this code you need to stick to some naming conventions. Lets say for example we are modelling a car, the car has 4 wheels (as 4 child meshes) and you want a moving animation that animates all 4 wheels.

Funding is provided by the Community Development Block Grant (CDBG) program through the Housing and Community Development Act of 1974 (P.L. 93-383). This program, administered by the U.S. Department of Housing and Urban Development (HUD), requires that we develop our programs based upon a consolidated plan and that we work with Town residents and nonprofit agencies to identify needs.

The Community Development Department prepared fiscal years 2020 to 2024 Consolidated Plan, which was approved by HUD. In addition, every year the department prepares and submits to HUD an Annual Action Plan for funding and approval. This plan details the annual housing and community development needs and programs for the Town.

Community Development Department is responsible for overseeing, managing and administering projects that receive funding from HUD. Projects include the construction and rehabilitation of parks, streets, sidewalks, roads, senior centers, and handicap accessibility features in various low-mod areas within the Town.

HOME IMPROVEMENT PROGRAM: This program provides no-interest, deferred payment loans to qualified low and moderate income homeowners in the Town of Babylon. The purpose of the loan is to improve housing conditions and correct housing code violations by repairing and rehabilitating health and safety hazards, and bringing the home to meet Town Code. For more information about how to apply for this program, please call Community Development directly at (631) 957-3051, or email us at cdp...@townofbabylon.com.

PROGRAM HIGHLIGHTS: The maximum loan is $50,000 to correct substandard housing code violations. Payment of the loan is deferred until the property is sold, the title is transferred or the home is refinanced for cash out. Monthly payments are not required. The loan is secured by a mortgage placed against the property.

Eligibility Criteria: To qualify for the program, an applicant MUST meet all the following criteria: I.First Time Homeowner - as defined by HUD is a household that has not owned a home during the three year period immediately prior to the date of application for assistance. II.Purchased home must be occupied by the homeowner and be their principal residence. Family who attend a mortgage counseling session at LIHP and must be able to secure a mortgage and have an acceptable credit history. III.Family must have a minimum income of at least $30,000. Income Eligible Family - meaning a prospective buyer must have a gross annual income not exceeding the income limits for the area as listed below with overtime and assets also taken into consideration.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages