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

C++ OBJ importer #382

Conversation

StandingPadAnimations
Copy link
Collaborator

This introduces support for the C++ OBJ importer for Blender 3.5 and above

When MCprep opens the file picker, both OBJs and MTLs can be selected,
which was annoying when accidently selecting the MTL file of the OBJ.

This adds a quality of life improvement by replacing .mtl with .obj if
the user accidently clicks the MTL file
Copy link
Member

@TheDuckCow TheDuckCow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving with the confidence that you'll make the once change (reversion) below to maintain consistent backwards behavior (it's actually less code too)

res = None
if util.min_bv((3, 5)):
res = bpy.ops.wm.obj_import(
filepath=self.filepath, use_split_groups=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this diff hunk can be reverted. This "use_split_groups" works in 3.5 and equally in 3.4 and earlier, as written this would make 3.4 and earlier stop splitting out by objects from the source, which would not be good.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean, though I did catch the use of the wrong operator for 3.4 and below. In my testing, use_split_groups doesn't seem to work in 3.4 and below for the C++ importer

A mistake was made that made MCprep use the C++ OBJ importer in 3.4 and
below, which is incorrect behavior.
@StandingPadAnimations
Copy link
Collaborator Author

Anyway, I'll merge this now

@StandingPadAnimations StandingPadAnimations merged commit 72f3cb5 into Moo-Ack-Productions:dev Mar 9, 2023
@StandingPadAnimations StandingPadAnimations deleted the cpp-obj-importer branch March 9, 2023 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants