-
Notifications
You must be signed in to change notification settings - Fork 342
Fix sdf_exporter.py to be compatible with newer versions of Blender #2678
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
base: gz-sim9
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. Would you mind signing-off on your commits (see contributing guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for the contribution! I started reviewing it, but I quickly realized there are a lot of unrelated changes (e.g. style, removed comments, etc.) that make it harder to review. Could you please revert those changes keeping only the relevant changes that fix the bugs so the PR is as small as possible?
| filter_folder=True, | ||
| filemode=8, | ||
| ) | ||
| bpy.ops.wm.collada_export(filepath=prefix_path+meshes_folder_prefix+dae_filename, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep the path.join here? That is preferred over using + for paths. And since there aren't any other changes, could you revert this to the previous version to reduce the diff as much as possible.
| dae_filename = 'model.dae' | ||
| sdf_filename = 'model.sdf' | ||
| model_config_filename = 'model.config' | ||
| lightmap_filename = 'LightmapBaked.png' | ||
| model_name = 'my_model' | ||
| meshes_folder_prefix = 'meshes/' | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to remove the extra space. Please revert and minimize the diff.
|
|
||
| ######################################################################################################################## | ||
| ### Exports model.dae of the scene with textures, its corresponding model.sdf file, and a default model.config file #### | ||
| ######################################################################################################################## |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for removing this comment?
| #### export sdf xml based off the scene ##### | ||
| ############################################# | ||
| sdf = ET.Element("sdf", attrib={"version": "1.8"}) | ||
| mesh_objects = [o for o in objects if o.type == 'MESH'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert unnecessary changes. This is only changing double quotes to single quotes. The rest of the file uses double quotes and I think it's best to stick with that.
d7a295a to
f8df892
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have made those changes and tested it on all the 4. versions of the blender can u please go through it i have kept it intact as much as i could thnx for the guidance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. I only have one small comment.
|
@mahit2609, can you please rebase on the latest |
Signed-off-by: mahit2609<mahitgeozujames@gmail.com> Signed-off-by: mahit2609 <mahitgeozujames@gmail.com>
|
@azeey the DCO is fixed now , Apologies for the delay. I was dealing with some personal/health issues and was very busy. Thank you for your patience! |
Signed-off-by: mahit2609 <mahitgeozujames@gmail.com>
Fix Blender SDF Export Tool for Blender 4.2.3
Overview
This PR fixes compatibility issues with Blender 4.2.3, as the original code was non-functional in newer Blender versions. The changes include API updates and bug fixes to ensure proper functionality.
Key Changes
Updated code to work with Blender 4.2.3's API
Fixed broken light handling and material processing
Updated type checks and property access to match current Blender standards
Notes
Tested working on Blender 4.2.3
Previous version was non-functional on newer Blender releases
Maintains same export format for model.dae, model.sdf, and model.config files