708
698
static void node_shader_buts_mapping(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
700
uiLayout *row, *col, *sub;
712
702
uiItemR(layout, ptr, "vector_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
714
uiItemL(layout, IFACE_("Location:"), ICON_NONE);
715
row = uiLayoutRow(layout, TRUE);
716
uiItemR(row, ptr, "translation", 0, "", ICON_NONE);
718
uiItemL(layout, IFACE_("Rotation:"), ICON_NONE);
719
row = uiLayoutRow(layout, TRUE);
720
uiItemR(row, ptr, "rotation", 0, "", ICON_NONE);
722
uiItemL(layout, IFACE_("Scale:"), ICON_NONE);
723
row = uiLayoutRow(layout, TRUE);
724
uiItemR(row, ptr, "scale", 0, "", ICON_NONE);
726
row = uiLayoutRow(layout, TRUE);
727
uiItemR(row, ptr, "use_min", 0, IFACE_("Min"), ICON_NONE);
728
uiItemR(row, ptr, "min", 0, "", ICON_NONE);
730
row = uiLayoutRow(layout, TRUE);
731
uiItemR(row, ptr, "use_max", 0, IFACE_("Max"), ICON_NONE);
732
uiItemR(row, ptr, "max", 0, "", ICON_NONE);
704
row = uiLayoutRow(layout, FALSE);
706
col = uiLayoutColumn(row, TRUE);
707
uiItemL(col, IFACE_("Location:"), ICON_NONE);
708
uiItemR(col, ptr, "translation", 0, "", ICON_NONE);
710
col = uiLayoutColumn(row, TRUE);
711
uiItemL(col, IFACE_("Rotation:"), ICON_NONE);
712
uiItemR(col, ptr, "rotation", 0, "", ICON_NONE);
714
col = uiLayoutColumn(row, TRUE);
715
uiItemL(col, IFACE_("Scale:"), ICON_NONE);
716
uiItemR(col, ptr, "scale", 0, "", ICON_NONE);
718
row = uiLayoutRow(layout, FALSE);
720
col = uiLayoutColumn(row, TRUE);
721
uiItemR(col, ptr, "use_min", 0, IFACE_("Min"), ICON_NONE);
722
sub = uiLayoutColumn(col, TRUE);
723
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_min"));
724
uiItemR(sub, ptr, "min", 0, "", ICON_NONE);
726
col = uiLayoutColumn(row, TRUE);
727
uiItemR(col, ptr, "use_max", 0, IFACE_("Max"), ICON_NONE);
728
sub = uiLayoutColumn(col, TRUE);
729
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_max"));
730
uiItemR(sub, ptr, "max", 0, "", ICON_NONE);
735
733
static void node_shader_buts_vect_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
971
989
switch (ntype->type) {
972
990
case SH_NODE_MATERIAL:
973
991
case SH_NODE_MATERIAL_EXT:
974
ntype->uifunc = node_shader_buts_material;
992
ntype->draw_buttons = node_shader_buts_material;
976
994
case SH_NODE_TEXTURE:
977
ntype->uifunc = node_buts_texture;
995
ntype->draw_buttons = node_buts_texture;
979
997
case SH_NODE_NORMAL:
980
ntype->uifunc = node_buts_normal;
998
ntype->draw_buttons = node_buts_normal;
982
1000
case SH_NODE_CURVE_VEC:
983
ntype->uifunc = node_buts_curvevec;
1001
ntype->draw_buttons = node_buts_curvevec;
985
1003
case SH_NODE_CURVE_RGB:
986
ntype->uifunc = node_buts_curvecol;
1004
ntype->draw_buttons = node_buts_curvecol;
988
1006
case SH_NODE_MAPPING:
989
ntype->uifunc = node_shader_buts_mapping;
1007
ntype->draw_buttons = node_shader_buts_mapping;
991
1009
case SH_NODE_VALUE:
992
ntype->uifunc = node_buts_value;
1010
ntype->draw_buttons = node_buts_value;
994
1012
case SH_NODE_RGB:
995
ntype->uifunc = node_buts_rgb;
1013
ntype->draw_buttons = node_buts_rgb;
997
1015
case SH_NODE_MIX_RGB:
998
ntype->uifunc = node_buts_mix_rgb;
1016
ntype->draw_buttons = node_buts_mix_rgb;
1000
1018
case SH_NODE_VALTORGB:
1001
ntype->uifunc = node_buts_colorramp;
1019
ntype->draw_buttons = node_buts_colorramp;
1003
1021
case SH_NODE_MATH:
1004
ntype->uifunc = node_buts_math;
1022
ntype->draw_buttons = node_buts_math;
1006
1024
case SH_NODE_VECT_MATH:
1007
ntype->uifunc = node_shader_buts_vect_math;
1025
ntype->draw_buttons = node_shader_buts_vect_math;
1009
1027
case SH_NODE_VECT_TRANSFORM:
1010
ntype->uifunc = node_shader_buts_vect_transform;
1028
ntype->draw_buttons = node_shader_buts_vect_transform;
1012
1030
case SH_NODE_GEOMETRY:
1013
ntype->uifunc = node_shader_buts_geometry;
1031
ntype->draw_buttons = node_shader_buts_geometry;
1034
ntype->draw_buttons = node_shader_buts_lamp;
1015
1036
case SH_NODE_ATTRIBUTE:
1016
ntype->uifunc = node_shader_buts_attribute;
1037
ntype->draw_buttons = node_shader_buts_attribute;
1018
1039
case SH_NODE_WIREFRAME:
1019
ntype->uifunc = node_shader_buts_wireframe;
1040
ntype->draw_buttons = node_shader_buts_wireframe;
1021
1042
case SH_NODE_TEX_SKY:
1022
ntype->uifunc = node_shader_buts_tex_sky;
1043
ntype->draw_buttons = node_shader_buts_tex_sky;
1024
1045
case SH_NODE_TEX_IMAGE:
1025
ntype->uifunc = node_shader_buts_tex_image;
1026
ntype->uifuncbut = node_shader_buts_tex_image_details;
1046
ntype->draw_buttons = node_shader_buts_tex_image;
1047
ntype->draw_buttons_ex = node_shader_buts_tex_image_ex;
1028
1049
case SH_NODE_TEX_ENVIRONMENT:
1029
ntype->uifunc = node_shader_buts_tex_environment;
1050
ntype->draw_buttons = node_shader_buts_tex_environment;
1031
1052
case SH_NODE_TEX_GRADIENT:
1032
ntype->uifunc = node_shader_buts_tex_gradient;
1053
ntype->draw_buttons = node_shader_buts_tex_gradient;
1034
1055
case SH_NODE_TEX_MAGIC:
1035
ntype->uifunc = node_shader_buts_tex_magic;
1056
ntype->draw_buttons = node_shader_buts_tex_magic;
1037
1058
case SH_NODE_TEX_BRICK:
1038
ntype->uifunc = node_shader_buts_tex_brick;
1059
ntype->draw_buttons = node_shader_buts_tex_brick;
1040
1061
case SH_NODE_TEX_WAVE:
1041
ntype->uifunc = node_shader_buts_tex_wave;
1062
ntype->draw_buttons = node_shader_buts_tex_wave;
1043
1064
case SH_NODE_TEX_MUSGRAVE:
1044
ntype->uifunc = node_shader_buts_tex_musgrave;
1065
ntype->draw_buttons = node_shader_buts_tex_musgrave;
1046
1067
case SH_NODE_TEX_VORONOI:
1047
ntype->uifunc = node_shader_buts_tex_voronoi;
1068
ntype->draw_buttons = node_shader_buts_tex_voronoi;
1049
1070
case SH_NODE_TEX_COORD:
1050
ntype->uifunc = node_shader_buts_tex_coord;
1071
ntype->draw_buttons = node_shader_buts_tex_coord;
1052
1073
case SH_NODE_BUMP:
1053
ntype->uifunc = node_shader_buts_bump;
1074
ntype->draw_buttons = node_shader_buts_bump;
1055
1076
case SH_NODE_NORMAL_MAP:
1056
ntype->uifunc = node_shader_buts_normal_map;
1077
ntype->draw_buttons = node_shader_buts_normal_map;
1058
1079
case SH_NODE_TANGENT:
1059
ntype->uifunc = node_shader_buts_tangent;
1080
ntype->draw_buttons = node_shader_buts_tangent;
1061
1082
case SH_NODE_BSDF_GLOSSY:
1062
1083
case SH_NODE_BSDF_GLASS:
1063
1084
case SH_NODE_BSDF_REFRACTION:
1064
ntype->uifunc = node_shader_buts_glossy;
1085
ntype->draw_buttons = node_shader_buts_glossy;
1066
1087
case SH_NODE_SUBSURFACE_SCATTERING:
1067
ntype->uifunc = node_shader_buts_subsurface;
1088
ntype->draw_buttons = node_shader_buts_subsurface;
1090
case SH_NODE_VOLUME_SCATTER:
1091
ntype->draw_buttons = node_shader_buts_volume;
1093
case SH_NODE_VOLUME_ABSORPTION:
1094
ntype->draw_buttons = node_shader_buts_volume;
1069
1096
case SH_NODE_BSDF_TOON:
1070
ntype->uifunc = node_shader_buts_toon;
1097
ntype->draw_buttons = node_shader_buts_toon;
1072
1099
case SH_NODE_BSDF_HAIR:
1073
ntype->uifunc = node_shader_buts_hair;
1100
ntype->draw_buttons = node_shader_buts_hair;
1075
1102
case SH_NODE_SCRIPT:
1076
ntype->uifunc = node_shader_buts_script;
1077
ntype->uifuncbut = node_shader_buts_script_details;
1103
ntype->draw_buttons = node_shader_buts_script;
1104
ntype->draw_buttons_ex = node_shader_buts_script_ex;
1578
1608
uiItemR(layout, ptr, "use_antialiasing", 0, NULL, ICON_NONE);
1581
/* draw function for file output node sockets, displays only sub-path and format, no value button */
1582
static void node_draw_input_file_output(bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *node_ptr)
1584
bNodeTree *ntree = ptr->id.data;
1585
bNodeSocket *sock = ptr->data;
1587
PointerRNA inputptr, imfptr;
1590
row = uiLayoutRow(layout, FALSE);
1592
imfptr = RNA_pointer_get(node_ptr, "format");
1593
imtype = RNA_enum_get(&imfptr, "file_format");
1594
if (imtype == R_IMF_IMTYPE_MULTILAYER) {
1595
NodeImageMultiFileSocket *input = sock->storage;
1596
RNA_pointer_create(&ntree->id, &RNA_NodeOutputFileSlotLayer, input, &inputptr);
1598
uiItemL(row, input->layer, ICON_NONE);
1601
NodeImageMultiFileSocket *input = sock->storage;
1602
PropertyRNA *imtype_prop;
1603
const char *imtype_name;
1605
RNA_pointer_create(&ntree->id, &RNA_NodeOutputFileSlotFile, input, &inputptr);
1607
uiItemL(row, input->path, ICON_NONE);
1609
if (!RNA_boolean_get(&inputptr, "use_node_format"))
1610
imfptr = RNA_pointer_get(&inputptr, "format");
1612
imtype_prop = RNA_struct_find_property(&imfptr, "file_format");
1613
RNA_property_enum_name((bContext *)C, &imfptr, imtype_prop,
1614
RNA_property_enum_get(&imfptr, imtype_prop), &imtype_name);
1615
block = uiLayoutGetBlock(row);
1616
uiBlockSetEmboss(block, UI_EMBOSSP);
1617
uiItemL(row, imtype_name, ICON_NONE);
1618
uiBlockSetEmboss(block, UI_EMBOSSN);
1621
1611
static void node_composit_buts_file_output(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
1623
1613
PointerRNA imfptr = RNA_pointer_get(ptr, "format");
2296
2286
switch (ntype->type) {
2297
2287
case CMP_NODE_IMAGE:
2298
ntype->uifunc = node_composit_buts_image;
2299
ntype->uifuncbut = node_composit_buts_image_details;
2288
ntype->draw_buttons = node_composit_buts_image;
2289
ntype->draw_buttons_ex = node_composit_buts_image_ex;
2301
2291
case CMP_NODE_R_LAYERS:
2302
ntype->uifunc = node_composit_buts_renderlayers;
2292
ntype->draw_buttons = node_composit_buts_renderlayers;
2304
2294
case CMP_NODE_NORMAL:
2305
ntype->uifunc = node_buts_normal;
2295
ntype->draw_buttons = node_buts_normal;
2307
2297
case CMP_NODE_CURVE_VEC:
2308
ntype->uifunc = node_buts_curvevec;
2298
ntype->draw_buttons = node_buts_curvevec;
2310
2300
case CMP_NODE_CURVE_RGB:
2311
ntype->uifunc = node_buts_curvecol;
2301
ntype->draw_buttons = node_buts_curvecol;
2313
2303
case CMP_NODE_VALUE:
2314
ntype->uifunc = node_buts_value;
2304
ntype->draw_buttons = node_buts_value;
2316
2306
case CMP_NODE_RGB:
2317
ntype->uifunc = node_buts_rgb;
2307
ntype->draw_buttons = node_buts_rgb;
2319
2309
case CMP_NODE_FLIP:
2320
ntype->uifunc = node_composit_buts_flip;
2310
ntype->draw_buttons = node_composit_buts_flip;
2322
2312
case CMP_NODE_SPLITVIEWER:
2323
ntype->uifunc = node_composit_buts_splitviewer;
2313
ntype->draw_buttons = node_composit_buts_splitviewer;
2325
2315
case CMP_NODE_MIX_RGB:
2326
ntype->uifunc = node_buts_mix_rgb;
2316
ntype->draw_buttons = node_buts_mix_rgb;
2328
2318
case CMP_NODE_VALTORGB:
2329
ntype->uifunc = node_buts_colorramp;
2319
ntype->draw_buttons = node_buts_colorramp;
2331
2321
case CMP_NODE_CROP:
2332
ntype->uifunc = node_composit_buts_crop;
2322
ntype->draw_buttons = node_composit_buts_crop;
2334
2324
case CMP_NODE_BLUR:
2335
ntype->uifunc = node_composit_buts_blur;
2325
ntype->draw_buttons = node_composit_buts_blur;
2337
2327
case CMP_NODE_DBLUR:
2338
ntype->uifunc = node_composit_buts_dblur;
2328
ntype->draw_buttons = node_composit_buts_dblur;
2340
2330
case CMP_NODE_BILATERALBLUR:
2341
ntype->uifunc = node_composit_buts_bilateralblur;
2331
ntype->draw_buttons = node_composit_buts_bilateralblur;
2343
2333
case CMP_NODE_DEFOCUS:
2344
ntype->uifunc = node_composit_buts_defocus;
2334
ntype->draw_buttons = node_composit_buts_defocus;
2346
2336
case CMP_NODE_GLARE:
2347
ntype->uifunc = node_composit_buts_glare;
2337
ntype->draw_buttons = node_composit_buts_glare;
2349
2339
case CMP_NODE_TONEMAP:
2350
ntype->uifunc = node_composit_buts_tonemap;
2340
ntype->draw_buttons = node_composit_buts_tonemap;
2352
2342
case CMP_NODE_LENSDIST:
2353
ntype->uifunc = node_composit_buts_lensdist;
2343
ntype->draw_buttons = node_composit_buts_lensdist;
2355
2345
case CMP_NODE_VECBLUR:
2356
ntype->uifunc = node_composit_buts_vecblur;
2346
ntype->draw_buttons = node_composit_buts_vecblur;
2358
2348
case CMP_NODE_FILTER:
2359
ntype->uifunc = node_composit_buts_filter;
2349
ntype->draw_buttons = node_composit_buts_filter;
2361
2351
case CMP_NODE_MAP_VALUE:
2362
ntype->uifunc = node_composit_buts_map_value;
2352
ntype->draw_buttons = node_composit_buts_map_value;
2364
2354
case CMP_NODE_MAP_RANGE:
2365
ntype->uifunc = node_composit_buts_map_range;
2355
ntype->draw_buttons = node_composit_buts_map_range;
2367
2357
case CMP_NODE_TIME:
2368
ntype->uifunc = node_buts_time;
2358
ntype->draw_buttons = node_buts_time;
2370
2360
case CMP_NODE_ALPHAOVER:
2371
ntype->uifunc = node_composit_buts_alphaover;
2361
ntype->draw_buttons = node_composit_buts_alphaover;
2373
2363
case CMP_NODE_HUE_SAT:
2374
ntype->uifunc = node_composit_buts_hue_sat;
2364
ntype->draw_buttons = node_composit_buts_hue_sat;
2376
2366
case CMP_NODE_TEXTURE:
2377
ntype->uifunc = node_buts_texture;
2367
ntype->draw_buttons = node_buts_texture;
2379
2369
case CMP_NODE_DILATEERODE:
2380
ntype->uifunc = node_composit_buts_dilateerode;
2370
ntype->draw_buttons = node_composit_buts_dilateerode;
2382
2372
case CMP_NODE_INPAINT:
2383
ntype->uifunc = node_composit_buts_inpaint;
2373
ntype->draw_buttons = node_composit_buts_inpaint;
2385
2375
case CMP_NODE_DESPECKLE:
2386
ntype->uifunc = node_composit_buts_despeckle;
2376
ntype->draw_buttons = node_composit_buts_despeckle;
2388
2378
case CMP_NODE_OUTPUT_FILE:
2389
ntype->uifunc = node_composit_buts_file_output;
2390
ntype->uifuncbut = node_composit_buts_file_output_details;
2391
ntype->drawinputfunc = node_draw_input_file_output;
2379
ntype->draw_buttons = node_composit_buts_file_output;
2380
ntype->draw_buttons_ex = node_composit_buts_file_output_ex;
2393
2382
case CMP_NODE_DIFF_MATTE:
2394
ntype->uifunc = node_composit_buts_diff_matte;
2383
ntype->draw_buttons = node_composit_buts_diff_matte;
2396
2385
case CMP_NODE_DIST_MATTE:
2397
ntype->uifunc = node_composit_buts_distance_matte;
2386
ntype->draw_buttons = node_composit_buts_distance_matte;
2399
2388
case CMP_NODE_COLOR_SPILL:
2400
ntype->uifunc = node_composit_buts_color_spill;
2389
ntype->draw_buttons = node_composit_buts_color_spill;
2402
2391
case CMP_NODE_CHROMA_MATTE:
2403
ntype->uifunc = node_composit_buts_chroma_matte;
2392
ntype->draw_buttons = node_composit_buts_chroma_matte;
2405
2394
case CMP_NODE_COLOR_MATTE:
2406
ntype->uifunc = node_composit_buts_color_matte;
2395
ntype->draw_buttons = node_composit_buts_color_matte;
2408
2397
case CMP_NODE_SCALE:
2409
ntype->uifunc = node_composit_buts_scale;
2398
ntype->draw_buttons = node_composit_buts_scale;
2411
2400
case CMP_NODE_ROTATE:
2412
ntype->uifunc = node_composit_buts_rotate;
2401
ntype->draw_buttons = node_composit_buts_rotate;
2414
2403
case CMP_NODE_CHANNEL_MATTE:
2415
ntype->uifunc = node_composit_buts_channel_matte;
2404
ntype->draw_buttons = node_composit_buts_channel_matte;
2417
2406
case CMP_NODE_LUMA_MATTE:
2418
ntype->uifunc = node_composit_buts_luma_matte;
2407
ntype->draw_buttons = node_composit_buts_luma_matte;
2420
2409
case CMP_NODE_MAP_UV:
2421
ntype->uifunc = node_composit_buts_map_uv;
2410
ntype->draw_buttons = node_composit_buts_map_uv;
2423
2412
case CMP_NODE_ID_MASK:
2424
ntype->uifunc = node_composit_buts_id_mask;
2413
ntype->draw_buttons = node_composit_buts_id_mask;
2426
2415
case CMP_NODE_DOUBLEEDGEMASK:
2427
ntype->uifunc = node_composit_buts_double_edge_mask;
2416
ntype->draw_buttons = node_composit_buts_double_edge_mask;
2429
2418
case CMP_NODE_MATH:
2430
ntype->uifunc = node_buts_math;
2419
ntype->draw_buttons = node_buts_math;
2432
2421
case CMP_NODE_INVERT:
2433
ntype->uifunc = node_composit_buts_invert;
2422
ntype->draw_buttons = node_composit_buts_invert;
2435
2424
case CMP_NODE_PREMULKEY:
2436
ntype->uifunc = node_composit_buts_premulkey;
2425
ntype->draw_buttons = node_composit_buts_premulkey;
2438
2427
case CMP_NODE_VIEW_LEVELS:
2439
ntype->uifunc = node_composit_buts_view_levels;
2428
ntype->draw_buttons = node_composit_buts_view_levels;
2441
2430
case CMP_NODE_COLORBALANCE:
2442
ntype->uifunc = node_composit_buts_colorbalance;
2443
ntype->uifuncbut = node_composit_buts_colorbalance_but;
2431
ntype->draw_buttons = node_composit_buts_colorbalance;
2432
ntype->draw_buttons_ex = node_composit_buts_colorbalance_ex;
2445
2434
case CMP_NODE_HUECORRECT:
2446
ntype->uifunc = node_composit_buts_huecorrect;
2435
ntype->draw_buttons = node_composit_buts_huecorrect;
2448
2437
case CMP_NODE_ZCOMBINE:
2449
ntype->uifunc = node_composit_buts_zcombine;
2438
ntype->draw_buttons = node_composit_buts_zcombine;
2451
2440
case CMP_NODE_COMBYCCA:
2452
2441
case CMP_NODE_SEPYCCA:
2453
ntype->uifunc = node_composit_buts_ycc;
2442
ntype->draw_buttons = node_composit_buts_ycc;
2455
2444
case CMP_NODE_MOVIECLIP:
2456
ntype->uifunc = node_composit_buts_movieclip;
2457
ntype->uifuncbut = node_composit_buts_movieclip_details;
2445
ntype->draw_buttons = node_composit_buts_movieclip;
2446
ntype->draw_buttons_ex = node_composit_buts_movieclip_ex;
2459
2448
case CMP_NODE_STABILIZE2D:
2460
ntype->uifunc = node_composit_buts_stabilize2d;
2449
ntype->draw_buttons = node_composit_buts_stabilize2d;
2462
2451
case CMP_NODE_TRANSFORM:
2463
ntype->uifunc = node_composit_buts_transform;
2452
ntype->draw_buttons = node_composit_buts_transform;
2465
2454
case CMP_NODE_TRANSLATE:
2466
ntype->uifunc = node_composit_buts_translate;
2455
ntype->draw_buttons = node_composit_buts_translate;
2468
2457
case CMP_NODE_MOVIEDISTORTION:
2469
ntype->uifunc = node_composit_buts_moviedistortion;
2458
ntype->draw_buttons = node_composit_buts_moviedistortion;
2471
2460
case CMP_NODE_COLORCORRECTION:
2472
ntype->uifunc = node_composit_buts_colorcorrection;
2473
ntype->uifuncbut = node_composit_buts_colorcorrection_but;
2461
ntype->draw_buttons = node_composit_buts_colorcorrection;
2462
ntype->draw_buttons_ex = node_composit_buts_colorcorrection_ex;
2475
2464
case CMP_NODE_SWITCH:
2476
ntype->uifunc = node_composit_buts_switch;
2465
ntype->draw_buttons = node_composit_buts_switch;
2478
2467
case CMP_NODE_MASK_BOX:
2479
ntype->uifunc = node_composit_buts_boxmask;
2480
ntype->uibackdropfunc = node_composit_backdrop_boxmask;
2468
ntype->draw_buttons = node_composit_buts_boxmask;
2469
ntype->draw_backdrop = node_composit_backdrop_boxmask;
2482
2471
case CMP_NODE_MASK_ELLIPSE:
2483
ntype->uifunc = node_composit_buts_ellipsemask;
2484
ntype->uibackdropfunc = node_composit_backdrop_ellipsemask;
2472
ntype->draw_buttons = node_composit_buts_ellipsemask;
2473
ntype->draw_backdrop = node_composit_backdrop_ellipsemask;
2486
2475
case CMP_NODE_BOKEHIMAGE:
2487
ntype->uifunc = node_composit_buts_bokehimage;
2476
ntype->draw_buttons = node_composit_buts_bokehimage;
2489
2478
case CMP_NODE_BOKEHBLUR:
2490
ntype->uifunc = node_composit_buts_bokehblur;
2479
ntype->draw_buttons = node_composit_buts_bokehblur;
2492
2481
case CMP_NODE_VIEWER:
2493
ntype->uifunc = node_composit_buts_viewer;
2494
ntype->uifuncbut = node_composit_buts_viewer_but;
2495
ntype->uibackdropfunc = node_composit_backdrop_viewer;
2482
ntype->draw_buttons = node_composit_buts_viewer;
2483
ntype->draw_buttons_ex = node_composit_buts_viewer_ex;
2484
ntype->draw_backdrop = node_composit_backdrop_viewer;
2497
2486
case CMP_NODE_COMPOSITE:
2498
ntype->uifunc = node_composit_buts_composite;
2487
ntype->draw_buttons = node_composit_buts_composite;
2500
2489
case CMP_NODE_MASK:
2501
ntype->uifunc = node_composit_buts_mask;
2490
ntype->draw_buttons = node_composit_buts_mask;
2503
2492
case CMP_NODE_KEYINGSCREEN:
2504
ntype->uifunc = node_composit_buts_keyingscreen;
2493
ntype->draw_buttons = node_composit_buts_keyingscreen;
2506
2495
case CMP_NODE_KEYING:
2507
ntype->uifunc = node_composit_buts_keying;
2496
ntype->draw_buttons = node_composit_buts_keying;
2509
2498
case CMP_NODE_TRACKPOS:
2510
ntype->uifunc = node_composit_buts_trackpos;
2499
ntype->draw_buttons = node_composit_buts_trackpos;
2512
2501
case CMP_NODE_PLANETRACKDEFORM:
2513
ntype->uifunc = node_composit_buts_planetrackdeform;
2502
ntype->draw_buttons = node_composit_buts_planetrackdeform;
2834
2817
copy_v4_v4(r_color, std_node_socket_colors[type]);
2820
/* draw function for file output node sockets, displays only sub-path and format, no value button */
2821
static void node_file_output_socket_draw(bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *node_ptr)
2823
bNodeTree *ntree = ptr->id.data;
2824
bNodeSocket *sock = ptr->data;
2826
PointerRNA inputptr, imfptr;
2829
row = uiLayoutRow(layout, FALSE);
2831
imfptr = RNA_pointer_get(node_ptr, "format");
2832
imtype = RNA_enum_get(&imfptr, "file_format");
2833
if (imtype == R_IMF_IMTYPE_MULTILAYER) {
2834
NodeImageMultiFileSocket *input = sock->storage;
2835
RNA_pointer_create(&ntree->id, &RNA_NodeOutputFileSlotLayer, input, &inputptr);
2837
uiItemL(row, input->layer, ICON_NONE);
2840
NodeImageMultiFileSocket *input = sock->storage;
2841
PropertyRNA *imtype_prop;
2842
const char *imtype_name;
2844
RNA_pointer_create(&ntree->id, &RNA_NodeOutputFileSlotFile, input, &inputptr);
2846
uiItemL(row, input->path, ICON_NONE);
2848
if (!RNA_boolean_get(&inputptr, "use_node_format"))
2849
imfptr = RNA_pointer_get(&inputptr, "format");
2851
imtype_prop = RNA_struct_find_property(&imfptr, "file_format");
2852
RNA_property_enum_name((bContext *)C, &imfptr, imtype_prop,
2853
RNA_property_enum_get(&imfptr, imtype_prop), &imtype_name);
2854
block = uiLayoutGetBlock(row);
2855
uiBlockSetEmboss(block, UI_EMBOSSP);
2856
uiItemL(row, imtype_name, ICON_NONE);
2857
uiBlockSetEmboss(block, UI_EMBOSSN);
2837
2861
static void std_node_socket_draw(bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *node_ptr, const char *text)
2863
bNode *node = node_ptr->data;
2839
2864
bNodeSocket *sock = ptr->data;
2840
2865
int type = sock->typeinfo->type;
2841
2866
/*int subtype = sock->typeinfo->subtype;*/
2843
if ((sock->flag & SOCK_IN_USE) || (sock->flag & SOCK_HIDE_VALUE)) {
2868
/* XXX not nice, eventually give this node its own socket type ... */
2869
if (node->type == CMP_NODE_OUTPUT_FILE) {
2870
node_file_output_socket_draw(C, layout, ptr, node_ptr);
2874
if ((sock->in_out == SOCK_OUT) || (sock->flag & SOCK_IN_USE) || (sock->flag & SOCK_HIDE_VALUE)) {
2844
2875
node_socket_button_label(C, layout, ptr, node_ptr, text);