Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shapenet converter: duplicate file collision_geometry.obj in exported archives #225

Open
gabriel-v opened this issue Apr 26, 2022 · 4 comments

Comments

@gabriel-v
Copy link

After rebuilding the shapelib container and starting the parfor script, I observed something off with the archives:
Screenshot from 2022-04-26 18-33-49

There are 2 files with the same name.

When extracting, one of the files overwrites the other one.

Here are the offending lines:

tar.add(object_folder / 'kubric' / 'collision_geometry.obj',
arcname='collision_geometry.obj')
tar.add(object_folder / 'kubric' / 'model_watertight.obj',
arcname='collision_geometry.obj')

I suppose the second file should have arcname='model_watertight.obj', correct? I can't find documentation for the specific format this is converting to; I assume it's using the same format as the MOVi objects?

@MrXandbadas
Copy link
Contributor

MrXandbadas commented Apr 26, 2022

From what I've read in the code and here online your assumption on the name convention is correct.
When we add an object we need to pass through the noted two .obj files (both a collision_geometry file and a model_watertight file)
Try changing line 299 to arcname='model_watertight.obj' and let me know if it succeeds, i'll happily make a quick PR for someone to review if it does work


Edit (some Context I found:
#185
Qwlouse said:

To make this work for simulation you would need to create a collision mesh in obj format and a corresponding urdf file that you can pass as simulation_filename. If your mesh is watertight, you can take a look at the GSO preprocessing script about how to do that. If not, then things get complicated, and you will have to do more than that. The ShapeNet preprocessing scripts can serve as a starting point there.

Looking into the ShapeNet processing linked we see:

def stage1(object_folder: Path, logger=_DEFAULT_LOGGER):
source_path = object_folder / 'models' / 'model_normalized.obj'
target_path = object_folder / 'kubric' / 'model_watertight.obj'

Edit edit -- Woah brain broke, what is this

@gabriel-v
Copy link
Author

I made that change locally for line 299 and the archives look good. I have yet to verify them in the renderer, through; but the conflicting filename bug is solved by that change.

MrXandbadas added a commit to MrXandbadas/kubric that referenced this issue Apr 26, 2022
@MrXandbadas
Copy link
Contributor

Instead of spam the PR section I've added it into the current fork I have listed in the Pull Requests xD

@Qwlouse
Copy link
Collaborator

Qwlouse commented May 6, 2022

That is an excellent catch!
I'll have to regenerate the ShapeNet assets once the fix is in....

Qwlouse added a commit that referenced this issue May 6, 2022
* Adding Spotlight requirements

Added the spot_blend and spot_size parameters into the lights.py file.

Spot Blend is the roughness of the beam
Spot Size is the radius in deg 0 - 180

Blender.py was changed to add the needed parameters inside the blender handler. I think I added the correct identifiers and what not. I just copied the standard implementation as it was written.

The SpotLight was added in with the other forms of Lights

----------
Still need to look at the colors of the lights. Maybe refer to the issue in the main github of Kubric regarding the Color Class and its implementation.

* Update as per notes

Awesome notes from Qwlouse! can be found at PR #219

* As per #225

As per #225 fix implemented

* Update kubric/renderer/blender.py

Co-authored-by: Klaus Greff <[email protected]>

* Import Numpy

Bug Fix noted by Qwlouse

Co-authored-by: Klaus Greff <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants