Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_data_curves.py
| Show All 38 Lines | class DATA_PT_curves_surface(DataButtonsPanel, Panel): | ||||||||||||||||||
| def draw(self, context): | def draw(self, context): | ||||||||||||||||||
| layout = self.layout | layout = self.layout | ||||||||||||||||||
| ob = context.object | ob = context.object | ||||||||||||||||||
| layout.use_property_split = True | layout.use_property_split = True | ||||||||||||||||||
| layout.prop(ob.data, "surface") | layout.prop(ob.data, "surface") | ||||||||||||||||||
| layout.prop(ob.data, "surface_uv_map", text="UV Map") | has_surface = ob.data.surface is not None | ||||||||||||||||||
| if has_surface: | |||||||||||||||||||
JacquesLucke: I think the property should always be visible. Just maybe grayed out when no surface is set. | |||||||||||||||||||
Done Inline ActionsNot sure, we usually hide prop_search if the data to search from is not available? lichtwerk: Not sure, we usually hide prop_search if the data to search from is not available? | |||||||||||||||||||
Done Inline ActionsDo you have examples? JacquesLucke: Do you have examples? | |||||||||||||||||||
Done Inline ActionsReally dont have a strong opinion here, but searching for .prop_search(in the Proerties Editor gives a couple of examples that are conditional (preceeded by if-checking the existance of the data we are searching from) lichtwerk: Really dont have a strong opinion here, but searching for `.prop_search(`in the Proerties… | |||||||||||||||||||
Done Inline ActionsI disagree. We usually just gray out properties if they don't have an effect. This is more intuitive since you don't "lose" things in the UI-- instead the fact that they don't work is explicit. HooglyBoogly: I disagree. We usually just gray out properties if they don't have an effect. This is more… | |||||||||||||||||||
| layout.prop_search(ob.data, "surface_uv_map", ob.data.surface.data, "uv_layers", text="UV Map") | |||||||||||||||||||
| else: | |||||||||||||||||||
| row = layout.row() | |||||||||||||||||||
| row.prop(ob.data, "surface_uv_map", text="UV Map") | |||||||||||||||||||
| row.enabled = has_surface | |||||||||||||||||||
HooglyBooglyUnsubmitted Not Done Inline Actions
Any reason not to do it simpler like this? HooglyBoogly: Any reason not to do it simpler like this?
Also, usually `active` is used instead of `enabled`… | |||||||||||||||||||
| class CURVES_MT_add_attribute(Menu): | class CURVES_MT_add_attribute(Menu): | ||||||||||||||||||
| bl_label = "Add Attribute" | bl_label = "Add Attribute" | ||||||||||||||||||
| @staticmethod | @staticmethod | ||||||||||||||||||
| def add_standard_attribute(layout, curves, name, data_type, domain): | def add_standard_attribute(layout, curves, name, data_type, domain): | ||||||||||||||||||
| exists = curves.attributes.get(name) is not None | exists = curves.attributes.get(name) is not None | ||||||||||||||||||
| ▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines | |||||||||||||||||||
I think the property should always be visible. Just maybe grayed out when no surface is set.