Newer
Older
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
# node_tree
# Node tree for node based materials
# Type: NodeTree, (readonly)
# offset_z
# Give faces an artificial offset in the Z buffer for Z transparency
# Type: float in [-inf, inf], default 0.0
# paint_active_slot
# Index of active texture paint slot
# Type: int in [0, 32767], default 0
# paint_clone_slot
# Index of clone texture paint slot
# Type: int in [0, 32767], default 0
# pass_index
# Index number for the “Material Index” render pass
# Type: int in [0, 32767], default 0
# physics
# Game physics settings
# Type: MaterialPhysics, (readonly, never None)
# preview_render_type
# Type of preview render
# FLAT Flat, Flat XY plane.
# SPHERE Sphere, Sphere.
# CUBE Cube, Cube.
# MONKEY Monkey, Monkey.
# HAIR Hair, Hair strands.
# SPHERE_A World Sphere, Large sphere with sky.
# Type: enum in [‘FLAT’, ‘SPHERE’, ‘CUBE’, ‘MONKEY’, ‘HAIR’, ‘SPHERE_A’], default ‘FLAT’
# raytrace_mirror
# Raytraced reflection settings for the material
# Type: MaterialRaytraceMirror, (readonly, never None)
# raytrace_transparency
# Raytraced transparency settings for the material
# Type: MaterialRaytraceTransparency, (readonly, never None)
# roughness
# Oren-Nayar Roughness
# Type: float in [0, 3.14], default 0.0
# shadow_buffer_bias
# Factor to multiply shadow buffer bias with (0 is ignore)
# Type: float in [0, 10], default 0.0
# shadow_cast_alpha
# Shadow casting alpha, in use for Irregular and Deep shadow buffer
# Type: float in [0.001, 1], default 0.0
# shadow_only_type
# How to draw shadows
# SHADOW_ONLY_OLD Shadow and Distance, Old shadow only method.
# SHADOW_ONLY Shadow Only, Improved shadow only method.
# SHADOW_ONLY_SHADED Shadow and Shading, Improved shadow only method which also renders lightless areas as shadows.
# Type: enum in [‘SHADOW_ONLY_OLD’, ‘SHADOW_ONLY’, ‘SHADOW_ONLY_SHADED’], default ‘SHADOW_ONLY_OLD’
# shadow_ray_bias
# Shadow raytracing bias to prevent terminator problems on shadow boundary
# Type: float in [0, 0.25], default 0.0
# specular_color
# Specular color of the material
# Type: float array of 3 items in [0, inf], default (0.0, 0.0, 0.0)
# specular_hardness
# How hard (sharp) the specular reflection is
# Type: int in [1, 511], default 0
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
# specular_intensity
# How intense (bright) the specular reflection is
# Type: float in [0, 1], default 0.0
# specular_ior
# Specular index of refraction
# Type: float in [1, 10], default 0.0
# specular_ramp
# Color ramp used to affect specular shading
# Type: ColorRamp, (readonly)
# specular_ramp_blend
# Blending method of the ramp and the specular color
# Type: enum in [‘MIX’, ‘ADD’, ‘MULTIPLY’, ‘SUBTRACT’, ‘SCREEN’, ‘DIVIDE’, ‘DIFFERENCE’, ‘DARKEN’, ‘LIGHTEN’, ‘OVERLAY’, ‘DODGE’, ‘BURN’, ‘HUE’, ‘SATURATION’, ‘VALUE’, ‘COLOR’, ‘SOFT_LIGHT’, ‘LINEAR_LIGHT’], default ‘MIX’
# specular_ramp_factor
# Blending factor (also uses alpha in Colorband)
# Type: float in [0, 1], default 0.0
# specular_ramp_input
# How the ramp maps on the surface
# Type: enum in [‘SHADER’, ‘ENERGY’, ‘NORMAL’, ‘RESULT’], default ‘SHADER’
# specular_shader
# COOKTORR CookTorr, Use a Cook-Torrance shader.
# PHONG Phong, Use a Phong shader.
# BLINN Blinn, Use a Blinn shader.
# TOON Toon, Use a toon shader.
# WARDISO WardIso, Use a Ward anisotropic shader.
# Type: enum in [‘COOKTORR’, ‘PHONG’, ‘BLINN’, ‘TOON’, ‘WARDISO’], default ‘COOKTORR’
# specular_slope
# The standard deviation of surface slope
# Type: float in [0, 0.4], default 0.0
# specular_toon_size
# Size of specular toon area
# Type: float in [0, 1.53], default 0.0
# specular_toon_smooth
# Smoothness of specular toon area
# Type: float in [0, 1], default 0.0
# strand
# Strand settings for the material
# Type: MaterialStrand, (readonly, never None)
# subsurface_scattering
# Subsurface scattering settings for the material
# Type: MaterialSubsurfaceScattering, (readonly, never None)
# texture_paint_images
# Texture images used for texture painting
# Type: bpy_prop_collection of Image, (readonly)
# texture_paint_slots
# Texture slots defining the mapping and influence of textures
# Type: bpy_prop_collection of TexPaintSlot, (readonly)
# texture_slots
# Texture slots defining the mapping and influence of textures
# Type: MaterialTextureSlots bpy_prop_collection of MaterialTextureSlot, (readonly)
# translucency
# Amount of diffuse shading on the back side
# Type: float in [0, 1], default 0.0
# transparency_method
# Method to use for rendering transparency
# MASK Mask, Mask the background.
# Z_TRANSPARENCY Z Transparency, Use alpha buffer for transparent faces.
# RAYTRACE Raytrace, Use raytracing for transparent refraction rendering.
# Type: enum in [‘MASK’, ‘Z_TRANSPARENCY’, ‘RAYTRACE’], default ‘MASK’
# type
# Material type defining how the object is rendered
# SURFACE Surface, Render object as a surface.
# WIRE Wire, Render the edges of faces as wires (not supported in raytracing).
# VOLUME Volume, Render object as a volume.
# HALO Halo, Render object as halo particles.
# Type: enum in [‘SURFACE’, ‘WIRE’, ‘VOLUME’, ‘HALO’], default ‘SURFACE’
# use_cast_approximate
# Allow this material to cast shadows when using approximate ambient occlusion
# Type: boolean, default False
# use_cast_buffer_shadows
# Allow this material to cast shadows from shadow buffer lamps
# Type: boolean, default False
# use_cast_shadows
# Allow this material to cast shadows
# Type: boolean, default False
# use_cast_shadows_only
# Make objects with this material appear invisible (not rendered), only casting shadows
# Type: boolean, default False
# use_cubic
# Use cubic interpolation for diffuse values, for smoother transitions
# Type: boolean, default False
# use_diffuse_ramp
# Toggle diffuse ramp operations
# Type: boolean, default False
# use_face_texture
# Replace the object’s base color with color from UV map image textures
# Type: boolean, default False
# use_face_texture_alpha
# Replace the object’s base alpha value with alpha from UV map image textures
# Type: boolean, default False
# use_full_oversampling
# Force this material to render full shading/textures for all anti-aliasing samples
# Type: boolean, default False
# use_light_group_exclusive
# Material uses the light group exclusively - these lamps are excluded from other scene lighting
# Type: boolean, default False
# use_light_group_local
# When linked in, material uses local light group with the same name
# Type: boolean, default False
# use_mist
# Use mist with this material (in world settings)
# Type: boolean, default False
# use_nodes
# Use shader nodes to render the material
# Type: boolean, default False
# use_object_color
# Modulate the result with a per-object color
# Type: boolean, default False
# use_only_shadow
# Render shadows as the material’s alpha value, making the material transparent except for shadowed areas
# Type: boolean, default False
# use_ray_shadow_bias
# Prevent raytraced shadow errors on surfaces with smooth shaded normals (terminator problem)
# Type: boolean, default False
# use_raytrace
# Include this material and geometry that uses it in raytracing calculations
# Type: boolean, default False
# use_shadeless
# Make this material insensitive to light or shadow
# Type: boolean, default False
# use_shadows
# Allow this material to receive shadows
# Type: boolean, default False
# use_sky
# Render this material with zero alpha, with sky background in place (scanline only)
# Type: boolean, default False
# use_specular_ramp
# Toggle specular ramp operations
# Type: boolean, default False
# use_tangent_shading
# Use the material’s tangent vector instead of the normal for shading - for anisotropic shading effects
# Type: boolean, default False
# use_textures
# Enable/Disable each texture
# Type: boolean array of 18 items, default (False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False)
# use_transparency
# Render material as transparent
# Type: boolean, default False
# use_transparent_shadows
# Allow this object to receive transparent shadows cast through other objects
# Type: boolean, default False
# use_uv_project
# Use to ensure UV interpolation is correct for camera projections (use with UV project modifier)
# Type: boolean, default False
# use_vertex_color_light
# Add vertex colors as additional lighting
# Type: boolean, default False
# use_vertex_color_paint
# Replace object base color with vertex colors (multiply with ‘texture face’ face assigned textures)
# Type: boolean, default False
# volume
# Volume settings for the material
# Type: MaterialVolume, (readonly, never None)
'''
(mat.type in {'SURFACE', 'WIRE', 'VOLUME'})
"use_transparency")
mat.use_transparency and mat.transparency_method == 'Z_TRANSPARENCY'
col.prop(mat, "use_raytrace")
col.prop(mat, "use_full_oversampling")
sub.prop(mat, "use_sky")
col.prop(mat, "use_cast_shadows", text="Cast")
col.prop(mat, "use_cast_shadows_only", text="Cast Only")
col.prop(mat, "use_cast_buffer_shadows")
sub.active = mat.use_cast_buffer_shadows
sub.prop(mat, "shadow_cast_alpha", text="Casting Alpha")
col.prop(mat, "use_cast_approximate")
col.prop(mat, "diffuse_color", text="")
sub.active = (not mat.use_shadeless)
sub.prop(mat, "diffuse_intensity", text="Intensity")
col.prop(mat, "diffuse_shader", text="")
col.prop(mat, "use_diffuse_ramp", text="Ramp")
if mat.diffuse_shader == 'OREN_NAYAR':
col.prop(mat, "roughness")
elif mat.diffuse_shader == 'MINNAERT':
col.prop(mat, "darkness")
elif mat.diffuse_shader == 'TOON':
row.prop(mat, "diffuse_toon_size", text="Size")
row.prop(mat, "diffuse_toon_smooth", text="Smooth")
elif mat.diffuse_shader == 'FRESNEL':
row.prop(mat, "diffuse_fresnel", text="Fresnel")
row.prop(mat, "diffuse_fresnel_factor", text="Factor")
if mat.use_diffuse_ramp:
col.template_color_ramp(mat, "diffuse_ramp", expand=True)
row.prop(mat, "diffuse_ramp_input", text="Input")
row.prop(mat, "diffuse_ramp_blend", text="Blend")
col.prop(mat, "diffuse_ramp_factor", text="Factor")
col.prop(mat, "specular_color", text="")
col.prop(mat, "specular_intensity", text="Intensity")
col.prop(mat, "specular_shader", text="")
col.prop(mat, "use_specular_ramp", text="Ramp")
if mat.specular_shader in {'COOKTORR', 'PHONG'}:
col.prop(mat, "specular_hardness", text="Hardness")
elif mat.specular_shader == 'BLINN':
row.prop(mat, "specular_hardness", text="Hardness")
row.prop(mat, "specular_ior", text="IOR")
elif mat.specular_shader == 'WARDISO':
col.prop(mat, "specular_slope", text="Slope")
elif mat.specular_shader == 'TOON':
row.prop(mat, "specular_toon_size", text="Size")
row.prop(mat, "specular_toon_smooth", text="Smooth")
if mat.use_specular_ramp:
layout.separator()
layout.template_color_ramp(mat, "specular_ramp", expand=True)
layout.separator()
row = layout.row()
row.prop(mat, "specular_ramp_input", text="Input")
row.prop(mat, "specular_ramp_blend", text="Blend")
layout.prop(mat, "specular_ramp_factor", text="Factor")
class MATERIAL_PT_shading(MaterialButtonsPanel, Panel):
bl_label = "Shading"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
@classmethod
def poll(cls, context):
mat = context.material
engine = context.scene.render.engine
return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
if mat.type in {'SURFACE', 'WIRE'}:
split = layout.split()
col = split.column()
sub = col.column()
sub.active = not mat.use_shadeless
sub.prop(mat, "emit")
sub.prop(mat, "ambient")
sub = col.column()
sub.prop(mat, "translucency")
col = split.column()
col.prop(mat, "use_shadeless")
sub = col.column()
sub.active = not mat.use_shadeless
sub.prop(mat, "use_tangent_shading")
sub.prop(mat, "use_cubic")
class MATERIAL_PT_transp(MaterialButtonsPanel, Panel):
bl_label = "Transparency"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
mat = context.material
engine = context.scene.render.engine
return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
mat = context.material
if simple_material(mat):
self.layout.prop(mat, "use_transparency", text="")
def draw(self, context):
layout = self.layout
base_mat = context.material
mat = active_node_mat(context.material)
rayt = mat.raytrace_transparency
if simple_material(base_mat):
row = layout.row()
row.active = mat.use_transparency
row.prop(mat, "transparency_method", expand=True)
split = layout.split()
split.active = base_mat.use_transparency
col = split.column()
col.prop(mat, "alpha")
row = col.row()
row.active = (base_mat.transparency_method != 'MASK') and (not mat.use_shadeless)
row.prop(mat, "specular_alpha", text="Specular")
col = split.column()
col.active = (not mat.use_shadeless)
col.prop(rayt, "fresnel")
sub = col.column()
sub.active = (rayt.fresnel > 0.0)
sub.prop(rayt, "fresnel_factor", text="Blend")
if base_mat.transparency_method == 'RAYTRACE':
layout.separator()
split = layout.split()
split.active = base_mat.use_transparency
col = split.column()
col.prop(rayt, "ior")
col.prop(rayt, "filter")
col.prop(rayt, "falloff")
col.prop(rayt, "depth_max")
col.prop(rayt, "depth")
col = split.column()
col.label(text="Gloss:")
col.prop(rayt, "gloss_factor", text="Amount")
sub = col.column()
sub.active = rayt.gloss_factor < 1.0
sub.prop(rayt, "gloss_threshold", text="Threshold")
sub.prop(rayt, "gloss_samples", text="Samples")
class MATERIAL_PT_mirror(MaterialButtonsPanel, Panel):
bl_label = "Mirror"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
mat = context.material
engine = context.scene.render.engine
return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
raym = active_node_mat(context.material).raytrace_mirror
self.layout.prop(raym, "use", text="")
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
raym = mat.raytrace_mirror
layout.active = raym.use
split = layout.split()
col = split.column()
col.prop(raym, "reflect_factor")
col.prop(mat, "mirror_color", text="")
col = split.column()
col.prop(raym, "fresnel")
sub = col.column()
sub.active = (raym.fresnel > 0.0)
sub.prop(raym, "fresnel_factor", text="Blend")
split = layout.split()
col = split.column()
col.separator()
col.prop(raym, "depth")
col.prop(raym, "distance", text="Max Dist")
col.separator()
sub = col.split(percentage=0.4)
sub.active = (raym.distance > 0.0)
sub.label(text="Fade To:")
sub.prop(raym, "fade_to", text="")
col = split.column()
col.label(text="Gloss:")
col.prop(raym, "gloss_factor", text="Amount")
sub = col.column()
sub.active = (raym.gloss_factor < 1.0)
sub.prop(raym, "gloss_threshold", text="Threshold")
sub.prop(raym, "gloss_samples", text="Samples")
sub.prop(raym, "gloss_anisotropic", text="Anisotropic")
class MATERIAL_PT_sss(MaterialButtonsPanel, Panel):
bl_label = "Subsurface Scattering"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
mat = context.material
engine = context.scene.render.engine
return check_material(mat) and (mat.type in {'SURFACE', 'WIRE'}) and (engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
mat = active_node_mat(context.material)
sss = mat.subsurface_scattering
self.layout.active = (not mat.use_shadeless)
self.layout.prop(sss, "use", text="")
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
sss = mat.subsurface_scattering
layout.active = (sss.use) and (not mat.use_shadeless)
row = layout.row().split()
sub = row.row(align=True).split(align=True, percentage=0.75)
sub.menu("MATERIAL_MT_sss_presets", text=bpy.types.MATERIAL_MT_sss_presets.bl_label)
sub.operator("material.sss_preset_add", text="", icon='ZOOMIN')
sub.operator("material.sss_preset_add", text="", icon='ZOOMOUT').remove_active = True
split = layout.split()
col = split.column()
col.prop(sss, "ior")
col.prop(sss, "scale")
col.prop(sss, "color", text="")
col.prop(sss, "radius", text="RGB Radius", expand=True)
col = split.column()
sub = col.column(align=True)
sub.label(text="Blend:")
sub.prop(sss, "color_factor", text="Color")
sub.prop(sss, "texture_factor", text="Texture")
sub.label(text="Scattering Weight:")
sub.prop(sss, "front")
sub.prop(sss, "back")
col.separator()
col.prop(sss, "error_threshold", text="Error")
class MATERIAL_PT_halo(MaterialButtonsPanel, Panel):
bl_label = "Halo"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
mat = context.material
engine = context.scene.render.engine
return mat and (mat.type == 'HALO') and (engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = context.material # don't use node material
halo = mat.halo
def number_but(layout, toggle, number, name, color):
row = layout.row(align=True)
row.prop(halo, toggle, text="")
sub = row.column(align=True)
sub.active = getattr(halo, toggle)
sub.prop(halo, number, text=name, translate=False)
if not color == "":
sub.prop(mat, color, text="")
split = layout.split()
col = split.column()
col.prop(mat, "alpha")
col.prop(mat, "diffuse_color", text="")
col.prop(halo, "seed")
col = split.column()
col.prop(halo, "size")
col.prop(halo, "hardness")
col.prop(halo, "add")
layout.label(text="Options:")
split = layout.split()
col = split.column()
col.prop(halo, "use_texture")
col.prop(halo, "use_vertex_normal")
col.prop(halo, "use_extreme_alpha")
col.prop(halo, "use_shaded")
col.prop(halo, "use_soft")
col = split.column()
number_but(col, "use_ring", "ring_count", iface_("Rings"), "mirror_color")
number_but(col, "use_lines", "line_count", iface_("Lines"), "specular_color")
number_but(col, "use_star", "star_tip_count", iface_("Star Tips"), "")
class MATERIAL_PT_flare(MaterialButtonsPanel, Panel):
bl_label = "Flare"
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
mat = context.material
engine = context.scene.render.engine
return mat and (mat.type == 'HALO') and (engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
halo = context.material.halo
self.layout.prop(halo, "use_flare_mode", text="")
def draw(self, context):
layout = self.layout
mat = context.material # don't use node material
halo = mat.halo
layout.active = halo.use_flare_mode
split = layout.split()
col = split.column()
col.prop(halo, "flare_size", text="Size")
col.prop(halo, "flare_boost", text="Boost")
col.prop(halo, "flare_seed", text="Seed")
col = split.column()
col.prop(halo, "flare_subflare_count", text="Subflares")
col.prop(halo, "flare_subflare_size", text="Subsize")
'''
#######################End Old Blender Internal Props##########################
###############################################################################
# Povray Nodes
###############################################################################
class PovraySocketUniversal(bpy.types.NodeSocket):
bl_idname = 'PovraySocketUniversal'
bl_label = 'Povray Socket'
value_unlimited: bpy.props.FloatProperty(default=0.0)
value_0_1: bpy.props.FloatProperty(min=0.0,max=1.0,default=0.0)
value_0_10: bpy.props.FloatProperty(min=0.0,max=10.0,default=0.0)
value_000001_10: bpy.props.FloatProperty(min=0.000001,max=10.0,default=0.0)
value_1_9: bpy.props.IntProperty(min=1,max=9,default=1)
value_0_255: bpy.props.IntProperty(min=0,max=255,default=0)
percent: bpy.props.FloatProperty(min=0.0,max=100.0,default=0.0)
def draw(self, context, layout, node, text):
space = context.space_data
tree = space.edit_tree
links=tree.links
if self.is_linked:
value=[]
for link in links:
if link.from_node==node:
inps=link.to_node.inputs
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
if inp.bl_idname=="PovraySocketFloat_0_1" and inp.is_linked:
prop="value_0_1"
if prop not in value:
value.append(prop)
if inp.bl_idname=="PovraySocketFloat_000001_10" and inp.is_linked:
prop="value_000001_10"
if prop not in value:
value.append(prop)
if inp.bl_idname=="PovraySocketFloat_0_10" and inp.is_linked:
prop="value_0_10"
if prop not in value:
value.append(prop)
if inp.bl_idname=="PovraySocketInt_1_9" and inp.is_linked:
prop="value_1_9"
if prop not in value:
value.append(prop)
if inp.bl_idname=="PovraySocketInt_0_255" and inp.is_linked:
prop="value_0_255"
if prop not in value:
value.append(prop)
if inp.bl_idname=="PovraySocketFloatUnlimited" and inp.is_linked:
prop="value_unlimited"
if prop not in value:
value.append(prop)
if len(value)==1:
layout.prop(self, "%s"%value[0], text=text)
else:
layout.prop(self, "percent", text="Percent")
else:
layout.prop(self, "percent", text=text)
def draw_color(self, context, node):
return (1, 0, 0, 1)
class PovraySocketFloat_0_1(bpy.types.NodeSocket):
bl_idname = 'PovraySocketFloat_0_1'
bl_label = 'Povray Socket'
default_value: bpy.props.FloatProperty(description="Input node Value_0_1",min=0,max=1,default=0)
def draw(self, context, layout, node, text):
if self.is_linked:
layout.label(text)
else:
layout.prop(self, "default_value", text=text, slider=True)
def draw_color(self, context, node):
return (0.5, 0.7, 0.7, 1)
class PovraySocketFloat_0_10(bpy.types.NodeSocket):
bl_idname = 'PovraySocketFloat_0_10'
bl_label = 'Povray Socket'
default_value: bpy.props.FloatProperty(description="Input node Value_0_10",min=0,max=10,default=0)
def draw(self, context, layout, node, text):
if node.bl_idname == 'ShaderNormalMapNode' and node.inputs[2].is_linked:
self.hide_value=True
if self.is_linked:
layout.label(text)
else:
layout.prop(self, "default_value", text=text, slider=True)
def draw_color(self, context, node):
return (0.65, 0.65, 0.65, 1)
class PovraySocketFloat_10(bpy.types.NodeSocket):
bl_idname = 'PovraySocketFloat_10'
bl_label = 'Povray Socket'
default_value: bpy.props.FloatProperty(description="Input node Value_10",min=-10,max=10,default=0)
def draw(self, context, layout, node, text):
if node.bl_idname == 'ShaderNormalMapNode' and node.inputs[2].is_linked:
self.hide_value=True
if self.is_linked:
layout.label(text)
else:
layout.prop(self, "default_value", text=text, slider=True)
def draw_color(self, context, node):
return (0.65, 0.65, 0.65, 1)
class PovraySocketFloatPositive(bpy.types.NodeSocket):
bl_idname = 'PovraySocketFloatPositive'
bl_label = 'Povray Socket'
default_value: bpy.props.FloatProperty(description="Input Node Value Positive", min=0.0, default=0)
def draw(self, context, layout, node, text):
if self.is_linked:
layout.label(text)
else:
layout.prop(self, "default_value", text=text, slider=True)
def draw_color(self, context, node):
return (0.045, 0.005, 0.136, 1)
class PovraySocketFloat_000001_10(bpy.types.NodeSocket):
bl_idname = 'PovraySocketFloat_000001_10'
bl_label = 'Povray Socket'
default_value: bpy.props.FloatProperty(min=0.000001,max=10,default=0.000001)
def draw(self, context, layout, node, text):
if self.is_output or self.is_linked:
layout.label(text)
else:
layout.prop(self, "default_value", text=text, slider=True)
def draw_color(self, context, node):
return (1, 0, 0, 1)
class PovraySocketFloatUnlimited(bpy.types.NodeSocket):
bl_idname = 'PovraySocketFloatUnlimited'
bl_label = 'Povray Socket'
default_value: bpy.props.FloatProperty(default = 0.0)
def draw(self, context, layout, node, text):
if self.is_linked:
layout.label(text)
else:
layout.prop(self, "default_value", text=text, slider=True)
def draw_color(self, context, node):
return (0.7, 0.7, 1, 1)
class PovraySocketInt_1_9(bpy.types.NodeSocket):
bl_idname = 'PovraySocketInt_1_9'
bl_label = 'Povray Socket'
default_value: bpy.props.IntProperty(description="Input node Value_1_9",min=1,max=9,default=6)
def draw(self, context, layout, node, text):
if self.is_linked:
layout.label(text)
else:
layout.prop(self, "default_value", text=text)
def draw_color(self, context, node):
return (1, 0.7, 0.7, 1)
class PovraySocketInt_0_256(bpy.types.NodeSocket):
bl_idname = 'PovraySocketInt_0_256'
bl_label = 'Povray Socket'
default_value: bpy.props.IntProperty(min=0,max=255,default=0)
def draw(self, context, layout, node, text):
if self.is_linked:
layout.label(text)
else:
layout.prop(self, "default_value", text=text)
def draw_color(self, context, node):
return (0.5, 0.5, 0.5, 1)
class PovraySocketPattern(bpy.types.NodeSocket):
bl_idname = 'PovraySocketPattern'
bl_label = 'Povray Socket'
default_value: bpy.props.EnumProperty(
name="Pattern",
description="Select the pattern",
items=(('boxed', "Boxed", ""),('brick', "Brick", ""),('cells', "Cells", ""), ('checker', "Checker", ""),
('granite', "Granite", ""),('leopard', "Leopard", ""),('marble', "Marble", ""),
('onion', "Onion", ""),('planar', "Planar", ""), ('quilted', "Quilted", ""),
('ripples', "Ripples", ""), ('radial', "Radial", ""),('spherical', "Spherical", ""),
('spotted', "Spotted", ""), ('waves', "Waves", ""), ('wood', "Wood", ""),
('wrinkles', "Wrinkles", "")),
default='granite')
def draw(self, context, layout, node, text):
if self.is_output or self.is_linked:
else:
layout.prop(self, "default_value", text=text)
def draw_color(self, context, node):
return (1, 1, 1, 1)
class PovraySocketColor(bpy.types.NodeSocket):
bl_idname = 'PovraySocketColor'
bl_label = 'Povray Socket'
default_value: bpy.props.FloatVectorProperty(
precision=4, step=0.01, min=0, soft_max=1,
default=(0.0, 0.0, 0.0), options={'ANIMATABLE'}, subtype='COLOR')
def draw(self, context, layout, node, text):
if self.is_output or self.is_linked:
layout.label(text)
else:
layout.prop(self, "default_value", text=text)
def draw_color(self, context, node):
return (1, 1, 0, 1)
class PovraySocketColorRGBFT(bpy.types.NodeSocket):
bl_idname = 'PovraySocketColorRGBFT'
bl_label = 'Povray Socket'
default_value: bpy.props.FloatVectorProperty(
precision=4, step=0.01, min=0, soft_max=1,
default=(0.0, 0.0, 0.0), options={'ANIMATABLE'}, subtype='COLOR')
f: bpy.props.FloatProperty(default = 0.0,min=0.0,max=1.0)
t: bpy.props.FloatProperty(default = 0.0,min=0.0,max=1.0)
def draw(self, context, layout, node, text):
if self.is_output or self.is_linked:
layout.label(text)
else:
layout.prop(self, "default_value", text=text)
def draw_color(self, context, node):
return (1, 1, 0, 1)
class PovraySocketTexture(bpy.types.NodeSocket):
bl_idname = 'PovraySocketTexture'
bl_label = 'Povray Socket'
default_value: bpy.props.IntProperty()
def draw(self, context, layout, node, text):
layout.label(text)
def draw_color(self, context, node):
return (0, 1, 0, 1)
class PovraySocketTransform(bpy.types.NodeSocket):
bl_idname = 'PovraySocketTransform'
bl_label = 'Povray Socket'
default_value: bpy.props.IntProperty(min=0,max=255,default=0)
def draw(self, context, layout, node, text):
layout.label(text)
def draw_color(self, context, node):
return (99/255, 99/255, 199/255, 1)
class PovraySocketNormal(bpy.types.NodeSocket):
bl_idname = 'PovraySocketNormal'
bl_label = 'Povray Socket'
default_value: bpy.props.IntProperty(min=0,max=255,default=0)
def draw(self, context, layout, node, text):
layout.label(text)
def draw_color(self, context, node):
return (0.65, 0.65, 0.65, 1)
class PovraySocketSlope(bpy.types.NodeSocket):
bl_idname = 'PovraySocketSlope'
bl_label = 'Povray Socket'
default_value: bpy.props.FloatProperty(min = 0.0, max = 1.0)
height: bpy.props.FloatProperty(min = 0.0, max = 10.0)
slope: bpy.props.FloatProperty(min = -10.0, max = 10.0)
def draw(self, context, layout, node, text):
if self.is_output or self.is_linked:
layout.label(text)
else:
layout.prop(self,'default_value',text='')