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

Code to manually offset bmesh's scaling problem. It's messy in principle but it works perfectly. #452

Closed
6 tasks done
FigureOfStickman opened this issue Jul 25, 2023 · 2 comments
Labels
asset-submission Contributing blend files to include as resources in MCprep itself enhancement Feature requests or new functionality suggestions

Comments

@FigureOfStickman
Copy link

FigureOfStickman commented Jul 25, 2023

bmesh scale fix

Hi! I hope this isn't inappropriate. I've never really used GitHub before.

I added this bit of code in my copy of the addon to rescale spawned blocks so that they aren't 1.008m^3. It's been working great so far, so I thought you guys may want to check it out. It's been bothering my adderall-riddled brain and StandingPadAnimations said it was a known issue.

Here's a screenshot of the code I added to mcmodel.py and what it looks like in Blender. I guess it automatically applies the scale because the operation is being performed on the raw mesh, so that cleans it up a bit for the user.

moddedmcprep Screenshot 2023-07-25 at 11 45 52 AM

Quality checks

  • I have used only vanilla textures (or created images that are derived from vanilla textures)
  • This is a vanilla minecraft asset/mob/effect
  • I have verified my asset has the correct scale (1 Blender unit = 1 meter), and the scale has been applied (control+a, scale)
  • If my asset includes a rig, I certified there is a "root" or "main" bone, and the rig object name ends with the name ".arma" or ".rig" to work well with MCprep
  • I am the sole creator of this rig, other than any textures by Mojang. Any custom textures I created myself.

Describe any usage details

Not a rig, I hope it's still okay for me to submit this though.

What name should we use to credit you in the README.md file?

FigureOfStickman

What credit url should we use to reference you in the README.md file?

youtube.com/@figureofstickman6718

Confirmation

  • By submitting this asset, I affirm the asset is of my own creation. I understand this asset will be included with MCprep with a CC-BY (attribution) license agreement, and that users of MCprep should refer to MCprep's readme for credit or directly name me for credit when this rig is used.
@FigureOfStickman FigureOfStickman added asset-submission Contributing blend files to include as resources in MCprep itself enhancement Feature requests or new functionality suggestions labels Jul 25, 2023
@zNightlord
Copy link
Contributor

zNightlord commented Jul 25, 2023

This is more a code thing so better off create a Pull Request.
But first I think you could try out poking around
mcmodel at line 66 I kinda talked about it in the Discord server. It is the source list of how the model verticies is made.
For your way, the block model spawn isn't just for block model, you can import any Minecraft Java json model into and it will be slightly scale if you do that.

@StandingPadAnimations
Copy link
Collaborator

StandingPadAnimations commented Jul 25, 2023

Thanks for submitting code! Like zNight said, this falls under Pull Requests (which are designed for code). I'd suggest reading https://github.com/Moo-Ack-Productions/MCprep/blob/dev/CONTRIBUTING.md for some more info.

One thing I'd suggest (just from looking) is checking to see if a particular dimension is close to 1m before resizing. Some blocks like slabs for example are 1m for X and Y, but not Z. Perhaps a simple "threshold" value that goes "if the dimension minus 1 is less then this threshold, then resize it to 1. Beyond that, I'll save further reviewing for a pull request

@StandingPadAnimations StandingPadAnimations linked a pull request Aug 10, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asset-submission Contributing blend files to include as resources in MCprep itself enhancement Feature requests or new functionality suggestions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants