Page MenuHome

UI: hide object instancing panel for object types that dont support instancing
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on May 21 2021, 6:09 PM.

Details

Summary

Basically, only meshes, empties and pointclouds support direct
instancing atm., no need to have the panel for other types.

note: prior to rB2eca054e14b1, collection instancing was possible on all
types (but that was removed in said commit)

note2: for empties, rna_Object_instance_type_itemf should also be
tweaked so we dont get "Vertices" and "Faces" options, but that can be
done in a separate commit

Diff Detail

Repository
rB Blender
Branch
T88443_d (branched from master)
Build Status
Buildable 14694
Build 14694: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.May 21 2021, 6:09 PM
Philipp Oeser (lichtwerk) created this revision.

Discussion from D11344:

I think this only affects the UI and not the underlying property, right?

As a user, I'm a little bit antsy about the idea of having properties which are still valid in the bpy API but will never be exposed in the GUI. It would open up the possibility for scripts to change file contents in a way that is impossible to discover and undo manually, and could then in turn affect other operations.

For example, the bundled "Copy Attributes" add-on has "Copy Dupli" and "Copy Draw Options" operators. That is able to change the setting on a Camera, which could then in turn affect either another script or some future built-in behaviour that eventually leads to problems later down the line— Causing hours to be wasted on trying to track down an errant setting that is impossible to see unless you specifically print it out by path in a console window.

I get the point, some extra care could be taken to warn if this is set from python on an object that does not really support this (or even prevent setting), not sure though if this is worth it

Is there a precedent for properties that are never exposed in the GUI? I know stuff with multiple modes like rotation values, Empty draw type, some modifiers, etc have properties that are only exposed conditionally.

Well, we have one right above my change: you can change the ob.color on a Camera [which is not in the GUI -- and does not have any effect -- same as bounds for Cameras], is that what you mean?

C.active_object.color = (0.0, 1.0, 0.0, 1.0)

Also applies to D11348 and maybe D11349.

Mind dropping a note there also? (it is just easier to keep track of - since these are separate Diffs we might forget about it otherwise)

This revision is now accepted and ready to land.Aug 10 2021, 2:24 PM
Taiseibutsu (Taiseibutsu) reopened this revision.EditedSep 9 2021, 1:18 AM

Should be visible for Text Objects at least, or just one option. Instancing by Vertex is needed to enable font objects.

This revision is now accepted and ready to land.Sep 9 2021, 1:18 AM

Should be visible for Text Objects at least, or just one option. Instancing by Vertex is needed to enable font objects.

Hi! Thx letting me know, will fix that

Should be fixed once D12438: Fix FONT objects cannot use Object Font anymore is in (thx again noticing).

Will close this Diff though (reopening Diffs is not the right way to report bugs).