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

Entities (Custom/Other Models) spawner category #148

Closed
5 of 13 tasks
TheDuckCow opened this issue Aug 28, 2020 · 10 comments · Fixed by #167
Closed
5 of 13 tasks

Entities (Custom/Other Models) spawner category #148

TheDuckCow opened this issue Aug 28, 2020 · 10 comments · Fixed by #167
Labels
enhancement Feature requests or new functionality suggestions
Milestone

Comments

@TheDuckCow
Copy link
Member

TheDuckCow commented Aug 28, 2020

This would be a place in MCprep, likely under the spawner panel, which would be used to spawn additional models/rigs that don't fit into the existing mob / item / block categories. This could be implemented as just a "Models" category under mob spawner, but this would not be that intuitive given these are not mobs. It could also be another section alongside Mobs, (Meshswap) Blocks, and Items.

Ideas of things to include (assumption is all of these would be custom, 3D models / rigs):

  • Rigged bows and crossbows
  • Boats with animatable oars
  • Minecarts, maybe with animatable wheels and toggles for Furnace, TNT, Hopper, and Chest
  • Rigged book, with page turning and enchanted material toggle
  • Signposts with text ready for editing
  • Item stand (possibly rigged)
  • Rigged piston (this probably would be better suited as a meshswap block though)
  • Arrows
  • Bowls
  • Potions
  • Trident
  • Elytra
  • Fishing rod rig

See more here

@TheDuckCow TheDuckCow added the enhancement Feature requests or new functionality suggestions label Aug 28, 2020
@Kabinet0
Copy link
Contributor

From what I understand, In order to do this, I need to add a few classes to Mcprep_ui.py something similar to the Item spawn class? My first goal is to make the ui appear

@Kabinet0
Copy link
Contributor

image
I Have added the draw class for the new button (I reused the Item code a bit) this code unfortunately, broke the whole MCprep panel & now it doesn't even appear, probably because of a bug in my code

@Kabinet0
Copy link
Contributor

Ok, I fixed that

@Kabinet0
Copy link
Contributor

Now It it almost works

@TheDuckCow
Copy link
Member Author

Thanks for working on this! One thing to ask - should we call this "models" or "entities"? I think entities might make more sense, to make it more obviously distinct from what is included in the meshswap file. ie, entities will be things that do not appear as blocks in world imports.

And to map out the key next steps here (not sure where you're at now):

  • The UI is one piece, looks like you are on your way with this one!
  • Then, you'll want to create an entity.py file, see this diff for various files you'd need to edit in order to get a new file loaded in properly. Note this also included a refactor beyond just the addition of the material_sync function, but hopefully you can see the main things like where we register the module and how to load in load_modules.py.
  • You'll want to make sure that "entities" are saved to their own global list in the conf.py file, and that their own properties (ie instead of scn_props.item_list, you'll have scn_props.entity_list and entity_list_index)
  • Likewise, some reload handlers will also need to be made/edited (one for specifically reloading models, and another which is editing the general spawners button)
  • You'll likely also want to add entity models to the Shift-A dropdown (also in the ui file, defined as a menu)
  • Then, you'll want to implement the loading mechanism. I think it will look or be identical to the Meshswap spawning code. In fact, it may be ideal to reuse the meshswap code as much as possible, just passing in custom blend file path for where entities are saved. The ultimate action is about the same: load the name of collections from a blend file, where each collection name represents an entity (including potentially a rig within that entity, but not always).
  • Finally - I see you forked MCprep here which is great, when you are ready for a code review or want me to look and give more specific feedback, you can now make a pull request to the dev branch of MCprep (better than screenshots of code). You can continue making edits after pull requests are made by pushing commits to your forked code, so don't worry about there being multiple commits or reversions in your forked repo.
    • I suggest running git status and git diff on your repo before adding changes just to verify what changes you have been making. Apologies if you're well versed in git already and you know about this, otherwise happy to supply some related tutorials based on whatever OS you are running on.

Let me know if you have any questions, and feel free to take it one step at a time!

@TheDuckCow TheDuckCow changed the title Custom/Other Models spawner category Entities (Custom/Other Models) spawner category Oct 19, 2020
@Kabinet0
Copy link
Contributor

Kabinet0 commented Oct 19, 2020

The mcprep panel is not being co-operative (or I am just being really dumb), so I am just leaving it alone for now and will access it from the shift-a menu, as a temporary measure so I can focus on the functionality.

@Kabinet0
Copy link
Contributor

Kabinet0 commented Oct 19, 2020

Update: I fixed The UI, but I am having troubles with assigning a model path. I am not well versed in git, and only know the basics, I will look up how to run git status and diff. If you have any ideas on how to assign a model path, It would be appreciated :) I also pushed to my fork of the repo

@TheDuckCow
Copy link
Member Author

ops.py is blender core code, so what this really means is that the module wasn't registered or found. Looking in your latest snapshot, you correctly register within the file itself, and I see you correctly register here.

Sanity check, did you try restarting blender between code updates? It could be the old modules were still loaded. Because at a glance it seems like it should be registering ok. Let me know if restarting doesn't help.

@Kabinet0
Copy link
Contributor

I restart each time I change anything, My best guess is I have typo somewhere

@TheDuckCow TheDuckCow added this to the v3.2.5 milestone Nov 3, 2020
@TheDuckCow TheDuckCow modified the milestones: v3.2.5, v3.2.6 Jun 8, 2021
@TheDuckCow TheDuckCow linked a pull request Jun 12, 2021 that will close this issue
@TheDuckCow
Copy link
Member Author

Closing this now as the feature is now polished with a UI wrapped around! Any future bugs or improvements can be added with new issue reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests or new functionality suggestions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants