Changeset View
Changeset View
Standalone View
Standalone View
render_povray/nodes.py
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | class ObjectNodeTree(bpy.types.NodeTree): | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return context.scene.render.engine == 'POVRAY_RENDER' | return context.scene.render.engine == 'POVRAY_RENDER' | ||||
| @classmethod | @classmethod | ||||
| def get_from_context(cls, context): | def get_from_context(cls, context): | ||||
| ob = context.active_object | ob = context.active_object | ||||
| if ob and ob.type not in {'LAMP'}: | if ob and ob.type not in {'LIGHT'}: | ||||
| ma = ob.active_material | ma = ob.active_material | ||||
| if ma is not None: | if ma is not None: | ||||
| nt_name = ma.node_tree | nt_name = ma.node_tree | ||||
| if nt_name != '': | if nt_name != '': | ||||
| return nt_name, ma, ma | return nt_name, ma, ma | ||||
| return (None, None, None) | return (None, None, None) | ||||
| def update(self): | def update(self): | ||||
| ▲ Show 20 Lines • Show All 448 Lines • ▼ Show 20 Lines | def draw_buttons(self, context, layout): | ||||
| column=layout.column() | column=layout.column() | ||||
| im=None | im=None | ||||
| for image in bpy.data.images: | for image in bpy.data.images: | ||||
| if image.name == self.image: | if image.name == self.image: | ||||
| im=image | im=image | ||||
| split = column.split(percentage=0.8,align=True) | split = column.split(percentage=0.8,align=True) | ||||
| split.prop_search(self,"image",context.blend_data,"images",text="") | split.prop_search(self,"image",context.blend_data,"images",text="") | ||||
| split.operator("pov.imageopen",text="",icon="FILESEL") | split.operator("pov.imageopen",text="",icon="FILEBROWSER") | ||||
| if im is not None: | if im is not None: | ||||
| column.prop(im,"source",text="") | column.prop(im,"source",text="") | ||||
| column.prop(self,"map_type",text="") | column.prop(self,"map_type",text="") | ||||
| column.prop(self,"interpolate",text="") | column.prop(self,"interpolate",text="") | ||||
| row=column.row() | row=column.row() | ||||
| row.prop(self,"premultiplied",text="Premul") | row.prop(self,"premultiplied",text="Premul") | ||||
| row.prop(self,"once",text="Once") | row.prop(self,"once",text="Once") | ||||
| def draw_buttons_ext(self, context, layout): | def draw_buttons_ext(self, context, layout): | ||||
| column=layout.column() | column=layout.column() | ||||
| im=None | im=None | ||||
| for image in bpy.data.images: | for image in bpy.data.images: | ||||
| if image.name == self.image: | if image.name == self.image: | ||||
| im=image | im=image | ||||
| split = column.split(percentage=0.8,align=True) | split = column.split(percentage=0.8,align=True) | ||||
| split.prop_search(self,"image",context.blend_data,"images",text="") | split.prop_search(self,"image",context.blend_data,"images",text="") | ||||
| split.operator("pov.imageopen",text="",icon="FILESEL") | split.operator("pov.imageopen",text="",icon="FILEBROWSER") | ||||
| if im is not None: | if im is not None: | ||||
| column.prop(im,"source",text="") | column.prop(im,"source",text="") | ||||
| column.prop(self,"map_type",text="") | column.prop(self,"map_type",text="") | ||||
| column.prop(self,"interpolate",text="") | column.prop(self,"interpolate",text="") | ||||
| row=column.row() | row=column.row() | ||||
| row.prop(self,"premultiplied",text="Premul") | row.prop(self,"premultiplied",text="Premul") | ||||
| row.prop(self,"once",text="Once") | row.prop(self,"once",text="Once") | ||||
| ▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | def draw_buttons(self, context, layout): | ||||
| column=layout.column() | column=layout.column() | ||||
| im=None | im=None | ||||
| for image in bpy.data.images: | for image in bpy.data.images: | ||||
| if image.name == self.image: | if image.name == self.image: | ||||
| im=image | im=image | ||||
| split = column.split(percentage=0.8,align=True) | split = column.split(percentage=0.8,align=True) | ||||
| split.prop_search(self,"image",context.blend_data,"images",text="") | split.prop_search(self,"image",context.blend_data,"images",text="") | ||||
| split.operator("pov.imageopen",text="",icon="FILESEL") | split.operator("pov.imageopen",text="",icon="FILEBROWSER") | ||||
| if im is not None: | if im is not None: | ||||
| column.prop(im,"source",text="") | column.prop(im,"source",text="") | ||||
| column.prop(self,"map_type",text="") | column.prop(self,"map_type",text="") | ||||
| column.prop(self,"interpolate",text="") | column.prop(self,"interpolate",text="") | ||||
| column.prop(self,"once",text="Once") | column.prop(self,"once",text="Once") | ||||
| def draw_buttons_ext(self, context, layout): | def draw_buttons_ext(self, context, layout): | ||||
| column=layout.column() | column=layout.column() | ||||
| im=None | im=None | ||||
| for image in bpy.data.images: | for image in bpy.data.images: | ||||
| if image.name == self.image: | if image.name == self.image: | ||||
| im=image | im=image | ||||
| split = column.split(percentage=0.8,align=True) | split = column.split(percentage=0.8,align=True) | ||||
| split.prop_search(self,"image",context.blend_data,"images",text="") | split.prop_search(self,"image",context.blend_data,"images",text="") | ||||
| split.operator("pov.imageopen",text="",icon="FILESEL") | split.operator("pov.imageopen",text="",icon="FILEBROWSER") | ||||
| if im is not None: | if im is not None: | ||||
| column.prop(im,"source",text="") | column.prop(im,"source",text="") | ||||
| column.prop(self,"map_type",text="") | column.prop(self,"map_type",text="") | ||||
| column.prop(self,"interpolate",text="") | column.prop(self,"interpolate",text="") | ||||
| column.prop(self,"once",text="Once") | column.prop(self,"once",text="Once") | ||||
| def draw_label(self): | def draw_label(self): | ||||
| return "Bump Map" | return "Bump Map" | ||||
| Show All 38 Lines | def draw_buttons(self, context, layout): | ||||
| column=layout.column() | column=layout.column() | ||||
| im=None | im=None | ||||
| for image in bpy.data.images: | for image in bpy.data.images: | ||||
| if image.name == self.image: | if image.name == self.image: | ||||
| im=image | im=image | ||||
| split = column.split(percentage=0.8,align=True) | split = column.split(percentage=0.8,align=True) | ||||
| split.prop_search(self,"image",context.blend_data,"images",text="") | split.prop_search(self,"image",context.blend_data,"images",text="") | ||||
| split.operator("pov.imageopen",text="",icon="FILESEL") | split.operator("pov.imageopen",text="",icon="FILEBROWSER") | ||||
| if im is not None: | if im is not None: | ||||
| column.prop(im,"source",text="") | column.prop(im,"source",text="") | ||||
| column.prop(self,"map_type",text="") | column.prop(self,"map_type",text="") | ||||
| column.prop(self,"interpolate",text="") | column.prop(self,"interpolate",text="") | ||||
| row=column.row() | row=column.row() | ||||
| row.prop(self,"premultiplied",text="Premul") | row.prop(self,"premultiplied",text="Premul") | ||||
| row.prop(self,"once",text="Once") | row.prop(self,"once",text="Once") | ||||
| column.prop(self,"use_alpha",text="Use alpha") | column.prop(self,"use_alpha",text="Use alpha") | ||||
| def draw_buttons_ext(self, context, layout): | def draw_buttons_ext(self, context, layout): | ||||
| column=layout.column() | column=layout.column() | ||||
| im=None | im=None | ||||
| for image in bpy.data.images: | for image in bpy.data.images: | ||||
| if image.name == self.image: | if image.name == self.image: | ||||
| im=image | im=image | ||||
| split = column.split(percentage=0.8,align=True) | split = column.split(percentage=0.8,align=True) | ||||
| split.prop_search(self,"image",context.blend_data,"images",text="") | split.prop_search(self,"image",context.blend_data,"images",text="") | ||||
| split.operator("pov.imageopen",text="",icon="FILESEL") | split.operator("pov.imageopen",text="",icon="FILEBROWSER") | ||||
| if im is not None: | if im is not None: | ||||
| column.prop(im,"source",text="") | column.prop(im,"source",text="") | ||||
| column.prop(self,"map_type",text="") | column.prop(self,"map_type",text="") | ||||
| column.prop(self,"interpolate",text="") | column.prop(self,"interpolate",text="") | ||||
| row=column.row() | row=column.row() | ||||
| row.prop(self,"premultiplied",text="Premul") | row.prop(self,"premultiplied",text="Premul") | ||||
| row.prop(self,"once",text="Once") | row.prop(self,"once",text="Once") | ||||
| ▲ Show 20 Lines • Show All 609 Lines • Show Last 20 Lines | |||||