-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add premade Lamp Flare. #182
Conversation
As noted in the WIP comment, still missing is the necessary Plasma Layer options, which would need to be set on a texture. I'm submitting this as a draft PR to solicit suggestions on how best to accomplish this. Should we pregenerate a default material and texture (and reuse it for subsequent flares), setting the flags needed such as No Z-Write? Without this, flares will appear incorrect by default. |
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.
The decal code takes an image input from the user and generates a new material and layer at export time. I think the same workflow would work well here even though it is model-time, not export-time.
Also, I didn't see this, but is the flare parented to the lamp? That might be a useful feature to have so it's easy to move the whole rigamaroll after making it.
There isn't an obvious way to do that for a Mesh Operator, though. Should I have it autogen a Material and select it, with a material selection box in the operator? That allows us to set up the plLayer settings, but it'll still need an image assigned to the texture slot. The ideal workflow is as follows: artist places the 3D cursor on their lamp mesh, presses Shift-A to Add->Plasma->Lamp Flare, and is given the current operator with an option to name it and the distance from the lamp to the flare so they can adjust it in real time before committing. It's parented, so if the size of the mesh changes or adjustments are needed, they can move the flare mesh on the Y-axis without breaking anything. What's missing is the material. An operator can't easily require a field, so if it's possible to leave either an image or material selection blank, the flare will be in an unusable state that isn't easily resolved without a walkthrough (which defeats the entire purpose of these). There's nothing "special" being created here, just pre-assembling a bunch of existing parts and modifiers using the settings we know need to be set behind-the-scenes. This leads me to think we should auto-generate on first-use a flare material with the appropriate settings. Unless we provide an image texture, this will still need to be set in some way. On subsequent uses, we can auto-select the last material matching the pre-gen name, or allow creation of a new one (for a different image/color tint flare). I'm not sure that there's any way to flag to the user that a flare is missing its image and guide them to rectifying this. This is the sort of thing that would be much easier to solve if Blender had some notion of modal operations. |
I've added code to automatically generate a working material and image texture. As with other guides, it requires some minor post-creation intervention, but in this case that only involves assigning an image to the texture slot. Once done, all flares before and after will benefit. @dpogue: This currently sets the "No Z-Write" |
This adds a new item to the
Add...Plasma...
menu which provides a pre-configured lamp flare.It creates a set of objects for an optimal, general-purpose glow around most lamps: