Replies: 5 comments 22 replies
-
Thanks for the great wrap up of recent developments! Am looking forward to try out v3 in january! :) |
Beta Was this translation helpful? Give feedback.
-
Hi Brian! Congrats to the recent update! I already read a bit through the recent changes and am curious to try out v3! Btw. I will try to reply this week to the nodeMaterial hook #105 . I am wondering how I should contribute the hook. It seems the storybooks are still based on v2. Will you still seperate them from this respository? |
Beta Was this translation helpful? Give feedback.
-
@dennemark You are right about docs on the hooks - completely missing!! I will work on adding that this week (not Typedoc just manually for now). For a node material hook - probably just add a new .ts file and export it and perhaps a storybook story showing usage. As for storybook it will stay in this project for the foreseeable future as it's really easy to test changes without npm linking and keeps the storybooks up-to-date - in fact, all stories should all be working against v3. |
Beta Was this translation helpful? Give feedback.
-
Hi Brian! congratulations and thanks for the latest update! |
Beta Was this translation helpful? Give feedback.
-
hi @gauravarya83 you can do import { useSceneLoader, ...} from 'react-babylonjs';
import '@babylonjs/loaders';
const MyModel = ({ rootUrl, sceneFilename, parentBoxPosition }) => {
const sceneLoaderResults = useSceneLoader(rootUrl, sceneFilename);
useEffect(() => {
return () => {
// console.log('disposing the sceneloader results.')
sceneLoaderResults.dispose();
}
}, []);
const [parentBox, _] = useState(() => return sceneLoaderResults.meshMap['parent box']}
return <>
<abstractMesh fromInstance={sceneLoaderResults.rootMesh!} {...rest} />
<mesh fromInstance={parentBox} position={parentBoxPosition} />
</>
} If that doesn't work - create an issue and we can work through it. If you have a public mesh we can use that as an example. Try to use the Scene Explorer to see if you have created the mesh - if it's in the same position as the original then it wouldn't be visible. |
Beta Was this translation helpful? Give feedback.
-
I have been absolutely swamped with work the last few weeks. Lots of working till midnight and that will continue at least another week, but then v3 will be out sometime after that :)
There are currently 2 v-next branches.
v3
andv3-proper
. v3 was an experimental branch wherebabylonjs-loaders
was a separate library that relied on another separate library for the Scene and Engine context. I was hoping it would provide a path for a vanilla solution that didn't require this reconciler necessarily and thebabylonjs-loaders
project could be used on both paths. It turned out to be a bit of a nightmare to work with - it required a lot of linking various projects and dependencies to work correctly and I think it would be a detriment to a clean developer experience and make it even harder to contribute, so abandoned that idea (and branch). The other thing I wanted to do was onuseRef
to not have amyRef.hostInstance
. I made a lot of changes in thev3
branch reconciler to support that and found that the fiber was not swapped when instances changed or moved around and additionally there is a built-in way on the reconciler 🤦 to provide the ref and still maintain the existing structure, which allows cleaner encapsulation and not polluting the babylon objects. Additionally, I added inv3-proper
some initial code that will (even declaratively) allow the babylon inspector to display custom metadata (and even actions) for react-babylonjs! So, I need to bring in some bug fixes and also the code where I added ability to specify primary or secondary renderer (with a fix for re-using same renderer when scene changes, which logs errors in console from react). I need to backport a few fixes fromv3
tov3-proper
and it will be set for a new beta release.TLDR:
v3-proper
will be the new v3 (ignore thev3
branch).Beta Was this translation helpful? Give feedback.
All reactions