You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a use case in R3F with this library to load multiple URDF models based on a state variable.
Basically the minimal reproducible example looks like the following
// We have multiple buttons at the bottom and user can select the urdf to render
const [urdfPath, setURDFPath] = useState("model1/default.urdf")
const object = useLoader(
URDFLoader,
`${apiUrl}/{urdfPath}`,
);
// Returns a list of buttons and a scene
Hi @gkjohnson ,
We have a use case in R3F with this library to load multiple URDF models based on a state variable.
Basically the minimal reproducible example looks like the following
In the first rendering the working path will be
${apiUrl}/model1
. (See how THREE.LoaderUtils.extractUrlBase extracts workingPath https://github.com/gkjohnson/urdf-loaders/blob/master/javascript/src/URDFLoader.js#L89In subsequent render user change the model to
model2/robot.urdf
. However the workingPath will not be updated https://github.com/gkjohnson/urdf-loaders/blob/master/javascript/src/URDFLoader.js#L115 and it uses the wrong model1 path to load the meshes for model2.To apply the fix remove the if condition check.
Thanks~
The text was updated successfully, but these errors were encountered: