Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/modules/bpy_extras/node_shader_utils.py
| Show First 20 Lines • Show All 744 Lines • ▼ Show 20 Lines | def node_mapping_get(self): | ||||
| self._node_mapping = node_mapping | self._node_mapping = node_mapping | ||||
| return self._node_mapping | return self._node_mapping | ||||
| node_mapping = property(node_mapping_get) | node_mapping = property(node_mapping_get) | ||||
| def translation_get(self): | def translation_get(self): | ||||
| return self.node_mapping.translation if self.node_mapping is not None else Vector((0.0, 0.0, 0.0)) | if self.node_mapping is None: | ||||
| return Vector((0.0, 0.0, 0.0)) | |||||
| # since elsewhere we are only supporting unmapped default values we should do this here, too? | |||||
| # otherwise we should check 'is_linked' | |||||
| return self.node_mapping.inputs['Location'].default_value | |||||
| @_set_check | @_set_check | ||||
| def translation_set(self, translation): | def translation_set(self, translation): | ||||
| self.node_mapping.translation = translation | self.node_mapping.inputs['Location'].default_value = translation | ||||
| translation = property(translation_get, translation_set) | translation = property(translation_get, translation_set) | ||||
| def rotation_get(self): | def rotation_get(self): | ||||
| return self.node_mapping.rotation if self.node_mapping is not None else Vector((0.0, 0.0, 0.0)) | if self.node_mapping is None: | ||||
| return Vector((0.0, 0.0, 0.0)) | |||||
| # since elsewhere we are only supporting unmapped default values we should do this here, too? | |||||
| # otherwise we should check 'is_linked' | |||||
| return self.node_mapping.inputs['Rotation'].default_value | |||||
| @_set_check | @_set_check | ||||
| def rotation_set(self, rotation): | def rotation_set(self, rotation): | ||||
| self.node_mapping.rotation = rotation | self.node_mapping.inputs['Rotation'].default_value = rotation | ||||
| rotation = property(rotation_get, rotation_set) | rotation = property(rotation_get, rotation_set) | ||||
| def scale_get(self): | def scale_get(self): | ||||
| return self.node_mapping.scale if self.node_mapping is not None else Vector((1.0, 1.0, 1.0)) | if self.node_mapping is None: | ||||
| return Vector((0.0, 0.0, 0.0)) | |||||
| # since elsewhere we are only supporting unmapped default values we should do this here, too? | |||||
| # otherwise we should check 'is_linked' | |||||
| return self.node_mapping.inputs['Scale'].default_value | |||||
| @_set_check | @_set_check | ||||
| def scale_set(self, scale): | def scale_set(self, scale): | ||||
| self.node_mapping.scale = scale | self.node_mapping.inputs['Scale'].default_value = scale | ||||
| scale = property(scale_get, scale_set) | scale = property(scale_get, scale_set) | ||||
| def use_min_get(self): | def use_min_get(self): | ||||
| return self.node_mapping.use_min if self.node_mapping is not None else False | return self.node_mapping.use_min if self.node_mapping is not None else False | ||||
| @_set_check | @_set_check | ||||
| Show All 34 Lines | |||||