Moo-Ack-Productions / MCprep

Blender python addon to increase workflow for creating minecraft renders and animations
https://theduckcow.com/MCprep
GNU General Public License v3.0
268 stars 26 forks source link

A feature to easily toggle the state of a redstone lamp, torch, etc (when material swapped). #433

Open FoxTale-Labs opened 1 year ago

FoxTale-Labs commented 1 year ago

Check against existing requests

Describe the context

Add a way where you can easily toggle the state of a redstone lamp, sea lantern, etc. who have a mesh swapped version between the lit and unlit version. Optimally with a keyframe. It will add the light source and update the texrture/model if different by the mesh swap blender file.

How do you imagine your feature works?

Every mesh swapped light source has a custom property called "Lit?" or a geometry node function. When toggled via either a keyframe or the user in the viewport it will replace the model, texture, and light source depending on the state based on the mesh swap blender file.

What existing workaround (or closest thing to a workaround) do you have today (within Blender, MCprep, or any software)? If there is no workaround, explain why you feel this way.

There isn't a way to do this at all. You just need to delete the original and create a new version of it, which is tedious and can't easily be done via animation.

zNightlord commented 1 year ago

Well I would treat this as more toward an asset that made by somebody. Since I have a block pack Geometry nodes driven (there is redstone lamp and weird state toggle snarios happen in that block pack)

What you need to do is add it into Meshswap asset blendfile and spawn bring it into your work file, *realized it of course. Because you use the word meshswap randomly i'm not sure what kind of meshswap or "mesh swap"

That is geometry solution. Material... well better not.

StandingPadAnimations commented 1 year ago

State of a block is exported by the world exporter. A way around this is to seperate the lamp (or lamps) from the OBJ, duplicate the material, add the unlit texture and switch between the 2 textures with a MixRGB.

StandingPadAnimations commented 1 year ago

Ahh wait, didn't read properly. For meshswapped objects, do F3 > Make Instances Real, then do all the material stuff

EDIT: Additional info below If you're wondering, meshswap isn't confined to single blocks, so we can't swap state on a per block basis. In addition, we use instances for performance reasons, which have to be made real in order to edit the material (making instances real consumes more memory though)