The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 94 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 573 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 573 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined variable $can_access_moderationqueue - Line: 752 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 752 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 892 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 892 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined variable $awaitingusers - Line: 34 - File: global.php(959) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(959) : eval()'d code 34 errorHandler->error
/global.php 959 eval
/showthread.php 28 require_once
Warning [2] Undefined array key "style" - Line: 1024 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 1024 errorHandler->error
/showthread.php 28 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5308 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5308 errorHandler->error
/global.php 1024 build_theme_select
/showthread.php 28 require_once
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1429 fetch_forum_permissions
/showthread.php 103 forum_permissions
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1439 fetch_forum_permissions
/inc/functions.php 3077 forum_permissions
/showthread.php 661 build_forum_jump
Warning [2] Undefined array key "mybb" - Line: 2121 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 2121 errorHandler->error
/inc/functions_indicators.php 41 my_set_array_cookie
/showthread.php 669 mark_thread_read
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "posttime" - Line: 9 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 9 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "avatar_padding" - Line: 19 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 19 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "posttime" - Line: 9 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 9 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "avatar_padding" - Line: 19 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 19 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "posttime" - Line: 9 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 9 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "avatar_padding" - Line: 19 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 19 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "posttime" - Line: 9 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 9 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "avatar_padding" - Line: 19 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 19 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "posttime" - Line: 9 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 9 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "avatar_padding" - Line: 19 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 19 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "posttime" - Line: 9 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 9 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "avatar_padding" - Line: 19 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 19 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key 1 - Line: 866 - File: inc/class_parser.php PHP 8.1.27 (Linux)
File Line Function
/inc/class_parser.php 866 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP] postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/inc/functions_post.php 785 postParser->parse_message
/showthread.php 1126 build_postbit
Warning [2] Undefined array key 1 - Line: 885 - File: inc/class_parser.php PHP 8.1.27 (Linux)
File Line Function
/inc/class_parser.php 885 errorHandler->error
/inc/class_parser.php 938 postParser->mycode_parse_post_quotes
[PHP] postParser->mycode_parse_post_quotes_callback1
/inc/class_parser.php 816 preg_replace_callback
/inc/class_parser.php 451 postParser->mycode_parse_quotes
/inc/class_parser.php 201 postParser->parse_mycode
/inc/functions_post.php 785 postParser->parse_message
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "posttime" - Line: 9 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 9 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "avatar_padding" - Line: 19 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 19 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "posttime" - Line: 9 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 9 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "avatar_padding" - Line: 19 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 19 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "posttime" - Line: 9 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 9 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "avatar_padding" - Line: 19 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 19 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "posttime" - Line: 9 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 9 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "avatar_padding" - Line: 19 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 19 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "posttime" - Line: 9 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 9 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "avatar_padding" - Line: 19 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 19 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "posttime" - Line: 9 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 9 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "avatar_padding" - Line: 19 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 19 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(484) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(484) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 484 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 672 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 672 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showimages" - Line: 768 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 768 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 773 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 773 errorHandler->error
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "posttime" - Line: 9 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 9 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "avatar_padding" - Line: 19 - File: inc/functions_post.php(906) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(906) : eval()'d code 19 errorHandler->error
/inc/functions_post.php 906 eval
/showthread.php 1126 build_postbit
Warning [2] Undefined array key "invisible" - Line: 1568 - File: showthread.php PHP 8.1.27 (Linux)
File Line Function
/showthread.php 1568 errorHandler->error
Warning [2] Undefined variable $threadnotesbox - Line: 33 - File: showthread.php(1600) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 33 errorHandler->error
/showthread.php 1600 eval
Warning [2] Undefined variable $addremovesubscription - Line: 82 - File: showthread.php(1600) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 82 errorHandler->error
/showthread.php 1600 eval
Warning [2] Undefined variable $thread_deleted - Line: 104 - File: showthread.php(1600) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(1600) : eval()'d code 104 errorHandler->error
/showthread.php 1600 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
blender python script help
08-12-2008, 01:23 PM,
#1
blender python script help
i am currently working on a track conversion from gp4 (hungaroring 2006) which i just added to svn and i need some help finishing it. the track is currently missing the surface coefficients (easy to do) and the starting grid/ pit lane markers. in gp4 these markers are drawn directly in the game as per some data files. what i would like to do is write a script which will help me create the markings in blender as meshes to be placed on top of the track. i don't know anything about writing blender scripts so i am asking here for help.

basically what needs to be done is this. given a track sector (a rectangle, so in blender i will select the four vertices) create a new mesh (another rectangle) to be positioned in the plane of the track sector (look at the z position) or a little bit above it and then be able to specify the x and y offsets from the bottom left corner and the width of the new mesh all as a fraction of the track sector dimensions.

this is a picture of what i am trying to do:

[Image: mesh.jpg]

i can do this one sector at a time. so for the first sector (top one), the x and y offset will be zero and the width will be 1. for the second one the x and y offsets will be, let's say, 0.05 and the width 0.3.

can anybody help me write this script (or at least come up with some examples on how to do this). thanks.

--alex--
Reply
08-12-2008, 03:57 PM,
#2
 
i've made some progress. the following script:

Code:
import Blender
from Blender import Mesh
myObj = Blender.Object.GetSelected()[0]
sel=[v for v in myObj.getData().verts if v.sel==1]
for v in sel:
    print "x,y,z: ", v[0], v[1], v[2]

will print the coordinates of the selected vertices but they get printed in the order they were present in the object and not the order i selected them (doesn't matter what order i selected them in, the output is always the same). any idea how to get the vertives in the order i selected them?

--alex--
Reply
08-12-2008, 07:16 PM,
#3
 
i am making progress. this is what i have so far:
Code:
import Blender
from Blender import *
import bpy

editmode = Window.EditMode()
if editmode: Blender.Window.EditMode(0)
me = bpy.data.meshes.new('myMesh')
myObj = Blender.Object.GetSelected()[0]
sel=[v for v in myObj.getData().verts if v.sel==1]
for v in sel:
    print "x,y,z: ", v[0], v[1], v[2]
    v[2] += 0.01
    me.verts.extend([v])

faces = [ [0,1,3,2] ]

me.faces.extend(faces)

me.faces[0].mat=0
fileName='grid.dds.png'
myTex = Texture.New()
myImage = Image.Load(fileName)
myTex.setType('Image')
myTex.image=myImage
me.faces[0].image = myImage
scn = bpy.data.scenes.active
ob = scn.objects.new(me, 'myObj')

Blender.Window.RedrawAll()

if editmode: Blender.Window.EditMode(1)
with this script i can select a track sector and then place on top of it a new mesh with a given texture. there is no scaling or offsetting yet (the new mesh covers the whole track sector) but this could probably be worked into something that will do what i want it to do. any advice is still welcome.

--alex--
Reply
08-13-2008, 10:05 PM,
#4
 
I can't help much, but good work so far.
Reply
08-15-2008, 02:29 PM,
#5
 
can somebody write an import script into blender for joe objects? we already have an export one, it would make life so much easier. ideally one would be able to specify multiple joe objects to be imported at the same time. i need to fix the textures for hungaroring (the track textures are all mapped on individual track sectors so they show up all bunched up creating ugly visual artifacts). alternatively, if one knows an easy way of fixing the textures (other than using blender,; even with blender i am not really sure how to do it) that will be great.

--alex--
Reply
08-16-2008, 12:56 PM,
#6
 
Have you tried this script from aegidian?
http://vdrift.net/Forum/viewtopic.php?p=8012#8012

Haven't tried it myself, but it looks like a commandline script that converts joe to obj. Maybe not as useful as a direct blender import, but does this help?
Reply
08-17-2008, 02:37 PM,
#7
 
joevenzon Wrote:Have you tried this script from aegidian?
http://vdrift.net/Forum/viewtopic.php?p=8012#8012

just tried it. the biggest problem is i can import only one object at a time. this makes it nearly impossible to import all the track objects into one blender session. second, the texture name is wrong, i had to fix it manually as it uses the joe object name appending png to it instead of reading the actual texture name (i don't know if that is stored in the object though). the biggest problem is my very limited knowledge of blender. i am still not sure how to unmap the texture from the track sector and make it span more than one sector.

--alex--
Reply
11-03-2008, 03:52 PM,
#8
 
Hi,
the texture name is only stored in the list.txt.
I've tried to write a script that loads joe files directly into blender and one to load the entire list.txt if the joe files are unpacked to the same directory with joepack.
I didn't succeed to get the normals right, but otherwise it seems to work.
And the faces in the track models seem to face in the opposite direction as the cars (cw vs ccw), perhaps that's because the normals are not imported, but i don't know really.
The scripts are based on the joe-exporter and md2-importer, and are my first experience with python.


import-joe.py
Code:
#!BPY

"""
Name: 'JOE (.joe)'
Blender: 239
Group: 'Import'
Tooltip: 'Import JOE file format. (.joe)'
"""
######################################################
# JOE Importer
# By:    Rikard Öxler, based on JOE exporter by Joe Venzon
#        and    MD2 importer by Bob Holcomb
# Date:    1 NOV 08
# Ver:    0.1
######################################################
# This script imports a JOE file, textures,
# and animations from blender.
######################################################

import Blender
from Blender import Mesh, Object, sys
from Blender.BGL import *
from Blender.Draw import *
from Blender.Window import *
from Blender.Mathutils import Vector
import struct
import sys
from types import *


######################################################
# Main Body
######################################################

#returns the string from a null terminated string
def asciiz (s):
  n = 0
  while (ord(s[n]) != 0):
    n = n + 1
  return s[0:n]


######################################################
# JOE Model Constants
######################################################
JOE_MAX_TRIANGLES=4096
JOE_MAX_VERTICES=2048
JOE_MAX_TEXCOORDS=2048
JOE_MAX_FRAMES=512
JOE_MAX_SKINS=32
JOE_MAX_FRAMESIZE=(JOE_MAX_VERTICES * 4 + 128)

######################################################
# JOE data structures
######################################################
class joe_alias_triangle(object):
    __slots__ = 'vertices',
    binary_format="<fff" #little-endian (<), 3 Unsigned char
    
    def __init__(self):
        self.vertices=[0]*3


    def load(self, file):
        temp_data = file.read(struct.calcsize(self.binary_format))
        data = struct.unpack(self.binary_format, temp_data)
        self.vertices[0]=data[0]
        self.vertices[1]=data[1]
        self.vertices[2]=data[2]
        return self

    def dump(self):
        print "JOE Alias_Triangle Structure"
        print "vertex: ", self.vertices[0]
        print "vertex: ", self.vertices[1]
        print "vertex: ", self.vertices[2]
        print ""

class joe_face(object):
    
    binary_format="<3h3h3h" #little-endian (<), 3 short, 3 short
    
    __slots__ = 'vertex_index', 'normal_index', 'texture_index'
    
    def __init__(self):
        self.vertex_index = [ 0, 0, 0 ]
        self.normal_index = [ 0, 0, 0 ]
        self.texture_index = [ 0, 0, 0]

    def load (self, file):
        temp_data=file.read(struct.calcsize(self.binary_format))
        data=struct.unpack(self.binary_format, temp_data)
        self.vertex_index[0]=data[0]
        self.vertex_index[1]=data[1]
        self.vertex_index[2]=data[2]
        self.normal_index[0]=data[3]
        self.normal_index[1]=data[4]
        self.normal_index[2]=data[5]
        self.texture_index[0]=data[6]
        self.texture_index[1]=data[7]
        self.texture_index[2]=data[8]
        return self

    def dump (self):
        print "JOE Face Structure"
        print "vertex index: ", self.vertex_index[0]
        print "vertex index: ", self.vertex_index[1]
        print "vertex index: ", self.vertex_index[2]
        print "normal index: ", self.normal_index[0]
        print "normal index: ", self.normal_index[1]
        print "normal index: ", self.normal_index[2]
        print "texture index: ", self.texture_index[0]
        print "texture index: ", self.texture_index[1]
        print "texture index: ", self.texture_index[2]
        print ""

class joe_tex_coord(object):
    __slots__ = 'u', 'v'
    binary_format="<2f" #little-endian (<), 2 float
    
    def __init__(self):
        self.u=0
        self.v=0

    def load (self, file):
        temp_data=file.read(struct.calcsize(self.binary_format))
        data=struct.unpack(self.binary_format, temp_data)
        self.u=data[0]
        self.v=data[1]
        return self

    def dump (self):
        print "JOE Texture Coordinate Structure"
        print "texture coordinate u: ",self.u
        print "texture coordinate v: ",self.v
        print ""


class joe_skin(object):
    __slots__ = 'name'
    binary_format="<64s" #little-endian (<), char[64]

    def __init__(self):
        self.name=""

    def load (self, file):
        temp_data=file.read(struct.calcsize(self.binary_format))
        data=struct.unpack(self.binary_format, temp_data)
        self.name=asciiz(data[0])
        return self

    def dump (self):
        print "JOE Skin"
        print "skin name: ",self.name
        print ""

class joe_alias_frame(object):
    __slots__ = 'faces', 'verts', 'texcoords', 'normals',\
    'num_vertices', 'num_normals', 'num_texcoords'
    '''
    num_vertices=0
    num_normals=0
    num_texcoords=0
    '''
    binary_format="<3i" #little-endian (<), 3 integers
    #num_vertices=0
    #num_texcoords=0
    #num_normals=0


    def __init__(self):
        self.faces=[]
        self.verts=[]
        self.texcoords=[]
        self.normals=[]

    def load (self, file):
        temp_data=file.read(struct.calcsize(self.binary_format))
        data=struct.unpack(self.binary_format, temp_data)
        self.num_vertices=data[0]
        self.num_texcoords=data[1]
        self.num_normals=data[2]
        for i in xrange(0, self.num_vertices):
            self.verts.append(joe_alias_triangle())
        for i in xrange(0, self.num_normals):
            self.normals.append(joe_alias_triangle())
        for i in xrange(0, self.num_texcoords):
            self.texcoords.append(joe_tex_coord())

        for i in xrange(0, self.num_vertices):
            self.verts[i].load(file)
            #self.verts[i].dump()
        for i in xrange(0, self.num_normals):
            self.normals[i].load(file)
            #self.normals[i].dump()
        for i in xrange(0, self.num_texcoords):
            self.texcoords[i].load(file)
            #self.texcoords[i].dump()
        return self

    def dump (self):
        print "JOE Alias Frame"
        print "number of verts: ",self.num_vertices
        print "number of texcoords",self.num_texcoords
        print "number of normals ",self.num_normals
        print ""

class joe_obj(object):
    __slots__ =\
    'frames',\
    'ident', 'version',\
    'num_faces',\
    'num_frames',\
    'skin_width', 'skin_height', 'num_skins',
    
    
    '''
    #Header Structure
    ident=0                #int 0    This is used to identify the file
    version=0            #int 1    The version number of the file (Must be 8)
    num_faces=0            #int 8    The number of faces (polygons)
    num_frames=0        #int 10    The number of animation frames
    '''
    binary_format="<4i"  #little-endian (<4> 0:
#        for i in xrange(0,joe.num_skins):
#            joe.skins[i].dump()
#            if (Blender.sys.exists(joe.skins[i].name)):
#                try:    return Blender.Image.Load(joe.skins[i].name)
#                except:    return -1
    

def animate_joe(joe, mesh):
    ######### Animate the verts through keyframe animation
    
    # Fast access to the meshes vertex coords
    verts = [v.co for v in mesh.verts]
    scale = g_scale.val
    
    for i in xrange(1, joe.num_frames):
        frame = joe.frames[i]
        #update the vertices
        for j in xrange(joe.num_vertices):
            x=(frame.verts[j].vertices[0]) * scale
            y=(frame.verts[j].vertices[1]) * scale
            z=(frame.verts[j].vertices[2]) * scale
            
            #put the vertex in the right spot
            verts[j][:] = y,-x,z
            
        mesh.insertKey(i,"absolute")
        # mesh.insertKey(i)
        
        #not really necissary, but I like playing with the frame counter
        Blender.Set("curframe", i)
    
    
    # Make the keys animate in the 3d view.
#    key = mesh.key
#    key.relative = False
    
    # Add an IPO to teh Key
#    ipo = Blender.Ipo.New('Key', 'joe')
#    key.ipo = ipo
    # Add a curve to the IPO
#    curve = ipo.addCurve('Basis')
    
    # Add 2 points to cycle through the frames.
#    curve.append((1, 0))
#    curve.append((joe.num_frames, (joe.num_frames-1)/10.0))
#    curve.interpolation = Blender.IpoCurve.InterpTypes.LINEAR
    


def load_joe(joe_filename, texture_filename):
    sys.stdout.flush()
    #read the file in
    file=open(joe_filename,"rb")
    WaitCursor(1)
    DrawProgressBar(0.0, 'Loading JOE')
    joe=joe_obj()
    joe.load(file)
    joe.dump()
    file.close()

    ######### Creates a new mesh
    mesh = Mesh.New()

    uv_coord=[]
    uv_list=[]
    verts_extend = []
    #load the textures to use later
    #-1 if there is no texture to load
    mesh_image=load_textures(joe, texture_filename)
    if mesh_image == -1 and texture_filename:
        print 'JOE Import, Warning, texture "%s" could not load'

    if (mesh_image != -1 and texture_filename != ""):
        size=mesh_image.getSize()
        #is this really what the user wants
    #    if (size[0]!=256 or size[1]!=256):
    #        result=Blender.Draw.PupMenu("Texture map size is not 256x256, it's: "+str(size[0])+"x"+str(size[1])+": Continue?%t|Yes|No")
    #        if(result==2):
    #            Exit()
        joe.skin_width=size[0]
        joe.skin_height=size[1]
        joe.num_skins = 1


    ######### Make the verts
    DrawProgressBar(0.25,"Loading Vertex Data")
    frame = joe.frames[0]
    scale = g_scale.val
    
    def tmp_get_vertex(i):
        #use the first frame for the mesh vertices
        x=(frame.verts[i].vertices[0])*scale
        y=(frame.verts[i].vertices[1])*scale
        z=(frame.verts[i].vertices[2])*scale
        return x,y,z

    def tmp_get_normal(i):
        #use the first frame for the mesh vertices
        x=(frame.normals[i].vertices[0])*scale
        y=(frame.normals[i].vertices[1])*scale
        z=(frame.normals[i].vertices[2])*scale
        return x,y,z
    
    mesh.verts.extend( [tmp_get_vertex(i) for i in xrange(0,frame.num_vertices)] )
    del tmp_get_vertex
    
    ######## Make the UV list
    DrawProgressBar(0.50,"Loading UV Data")
    
    #w = float(joe.skin_width)
    #h = float(joe.skin_height)
    #if w <= 0.0: w = 1.0
    #if h <0>blender
    g_scale= Slider("Scale Factor: ", EVENT_NOEVENT, 10, 75, 210, 18,
                    1.0, 0.001, 10.0, 1, "Scale factor for obj Model");

    ######### Draw and Exit Buttons
    Button("Load",EVENT_LOAD_JOE , 10, 10, 80, 18)
    Button("Exit",EVENT_EXIT , 170, 10, 80, 18)

def event(evt, val):    
    if (evt == QKEY and not val):
        Blender.Draw.Exit()

def bevent(evt):
    global g_joe_filename
    global g_texture_filename
    global EVENT_NOEVENT,EVENT_LOAD_JOE,EVENT_SAVE_JOE,EVENT_EXIT

    ######### Manages GUI events
    if (evt==EVENT_EXIT):
        Blender.Draw.Exit()
    elif (evt==EVENT_CHOOSE_FILENAME):
        FileSelector(filename_callback, "JOE File Selection")
    elif (evt==EVENT_CHOOSE_TEXTURE):
        FileSelector(texture_callback, "Texture Selection")
    elif (evt==EVENT_LOAD_JOE):
        if not Blender.sys.exists(g_joe_filename.val):
            PupMenu('Model file does not exist')
            return
        else:
            load_joe(g_joe_filename.val, g_texture_filename.val)
            Blender.Redraw()
            Blender.Draw.Exit()
            return

if __name__ == '__main__':
    Register(draw_gui, event, bevent)

and:
import-vdrift-list.py
Code:
#!BPY

"""
Name: 'VDrift (list.txt)'
Blender: 239
Group: 'Import'
Tooltip: 'Import VDrift tracks. (list.txt)'
"""
######################################################
# JOE Importer
# By:    Rikard Öxler, based on JOE exporter by Joe Venzon
#        and    MD2 importer by Bob Holcomb
# Date:    1 NOV 08
# Ver:    0.1
######################################################
# This script imports a JOE file, textures,
# and animations from blender.
######################################################

import Blender
from Blender import Mesh, Object, sys
from Blender.BGL import *
from Blender.Draw import *
from Blender.Window import *
from Blender.Mathutils import Vector
import struct
import sys
from types import *


######################################################
# Main Body
######################################################

#returns the string from a null terminated string
def asciiz (s):
  n = 0
  while (ord(s[n]) != 0):
    n = n + 1
  return s[0:n]


######################################################
# JOE Model Constants
######################################################
JOE_MAX_TRIANGLES=4096
JOE_MAX_VERTICES=2048
JOE_MAX_TEXCOORDS=2048
JOE_MAX_FRAMES=512
JOE_MAX_SKINS=32
JOE_MAX_FRAMESIZE=(JOE_MAX_VERTICES * 4 + 128)

######################################################
# JOE data structures
######################################################
class joe_alias_triangle(object):
    __slots__ = 'vertices',
    binary_format="<fff" #little-endian (<), 3 Unsigned char
    
    def __init__(self):
        self.vertices=[0]*3


    def load(self, file):
        temp_data = file.read(struct.calcsize(self.binary_format))
        data = struct.unpack(self.binary_format, temp_data)
        self.vertices[0]=data[0]
        self.vertices[1]=data[1]
        self.vertices[2]=data[2]
        return self

    def dump(self):
        print "JOE Alias_Triangle Structure"
        print "vertex: ", self.vertices[0]
        print "vertex: ", self.vertices[1]
        print "vertex: ", self.vertices[2]
        print ""

class joe_face(object):
    
    binary_format="<3h3h3h" #little-endian (<), 3 short, 3 short
    
    __slots__ = 'vertex_index', 'normal_index', 'texture_index'
    
    def __init__(self):
        self.vertex_index = [ 0, 0, 0 ]
        self.normal_index = [ 0, 0, 0 ]
        self.texture_index = [ 0, 0, 0]

    def load (self, file):
        temp_data=file.read(struct.calcsize(self.binary_format))
        data=struct.unpack(self.binary_format, temp_data)
        self.vertex_index[0]=data[0]
        self.vertex_index[1]=data[1]
        self.vertex_index[2]=data[2]
        self.normal_index[0]=data[3]
        self.normal_index[1]=data[4]
        self.normal_index[2]=data[5]
        self.texture_index[0]=data[6]
        self.texture_index[1]=data[7]
        self.texture_index[2]=data[8]
        return self

    def dump (self):
        print "JOE Face Structure"
        print "vertex index: ", self.vertex_index[0]
        print "vertex index: ", self.vertex_index[1]
        print "vertex index: ", self.vertex_index[2]
        print "normal index: ", self.normal_index[0]
        print "normal index: ", self.normal_index[1]
        print "normal index: ", self.normal_index[2]
        print "texture index: ", self.texture_index[0]
        print "texture index: ", self.texture_index[1]
        print "texture index: ", self.texture_index[2]
        print ""

class joe_tex_coord(object):
    __slots__ = 'u', 'v'
    binary_format="<2f" #little-endian (<), 2 float
    
    def __init__(self):
        self.u=0
        self.v=0

    def load (self, file):
        temp_data=file.read(struct.calcsize(self.binary_format))
        data=struct.unpack(self.binary_format, temp_data)
        self.u=data[0]
        self.v=data[1]
        return self

    def dump (self):
        print "JOE Texture Coordinate Structure"
        print "texture coordinate u: ",self.u
        print "texture coordinate v: ",self.v
        print ""


class joe_skin(object):
    __slots__ = 'name'
    binary_format="<64s" #little-endian (<), char[64]

    def __init__(self):
        self.name=""

    def load (self, file):
        temp_data=file.read(struct.calcsize(self.binary_format))
        data=struct.unpack(self.binary_format, temp_data)
        self.name=asciiz(data[0])
        return self

    def dump (self):
        print "JOE Skin"
        print "skin name: ",self.name
        print ""

class joe_alias_frame(object):
    __slots__ = 'faces', 'verts', 'texcoords', 'normals',\
    'num_vertices', 'num_normals', 'num_texcoords'
    '''
    num_vertices=0
    num_normals=0
    num_texcoords=0
    '''
    binary_format="<3i" #little-endian (<), 3 integers
    #num_vertices=0
    #num_texcoords=0
    #num_normals=0


    def __init__(self):
        self.faces=[]
        self.verts=[]
        self.texcoords=[]
        self.normals=[]

    def load (self, file):
        temp_data=file.read(struct.calcsize(self.binary_format))
        data=struct.unpack(self.binary_format, temp_data)
        self.num_vertices=data[0]
        self.num_texcoords=data[1]
        self.num_normals=data[2]
        for i in xrange(0, self.num_vertices):
            self.verts.append(joe_alias_triangle())
        for i in xrange(0, self.num_normals):
            self.normals.append(joe_alias_triangle())
        for i in xrange(0, self.num_texcoords):
            self.texcoords.append(joe_tex_coord())

        for i in xrange(0, self.num_vertices):
            self.verts[i].load(file)
            #self.verts[i].dump()
        for i in xrange(0, self.num_normals):
            self.normals[i].load(file)
            #self.normals[i].dump()
        for i in xrange(0, self.num_texcoords):
            self.texcoords[i].load(file)
            #self.texcoords[i].dump()
        return self

    def dump (self):
        print "JOE Alias Frame"
        print "number of verts: ",self.num_vertices
        print "number of texcoords",self.num_texcoords
        print "number of normals ",self.num_normals
        print ""

class joe_obj(object):
    __slots__ =\
    'frames',\
    'ident', 'version',\
    'num_faces',\
    'num_frames',\
    'skin_width', 'skin_height', 'num_skins',
    
    
    '''
    #Header Structure
    ident=0                #int 0    This is used to identify the file
    version=0            #int 1    The version number of the file (Must be 8)
    num_faces=0            #int 8    The number of faces (polygons)
    num_frames=0        #int 10    The number of animation frames
    '''
    binary_format="<4i"  #little-endian (<4> 0:
#        for i in xrange(0,joe.num_skins):
#            joe.skins[i].dump()
#            if (Blender.sys.exists(joe.skins[i].name)):
#                try:    return Blender.Image.Load(joe.skins[i].name)
#                except:    return -1
    

def animate_joe(joe, mesh):
    ######### Animate the verts through keyframe animation
    
    # Fast access to the meshes vertex coords
    verts = [v.co for v in mesh.verts]
    scale = g_scale.val
    
    for i in xrange(1, joe.num_frames):
        frame = joe.frames[i]
        #update the vertices
        for j in xrange(joe.num_vertices):
            x=(frame.verts[j].vertices[0]) * scale
            y=(frame.verts[j].vertices[1]) * scale
            z=(frame.verts[j].vertices[2]) * scale
            
            #put the vertex in the right spot
            verts[j][:] = y,-x,z
            
        mesh.insertKey(i,"absolute")
        # mesh.insertKey(i)
        
        #not really necissary, but I like playing with the frame counter
        Blender.Set("curframe", i)
    
    
    # Make the keys animate in the 3d view.
#    key = mesh.key
#    key.relative = False
    
    # Add an IPO to teh Key
#    ipo = Blender.Ipo.New('Key', 'joe')
#    key.ipo = ipo
    # Add a curve to the IPO
#    curve = ipo.addCurve('Basis')
    
    # Add 2 points to cycle through the frames.
#    curve.append((1, 0))
#    curve.append((joe.num_frames, (joe.num_frames-1)/10.0))
#    curve.interpolation = Blender.IpoCurve.InterpTypes.LINEAR
    


def load_joe(joe_filename, texture_filename):
    #sys.stdout.flush()
    #read the file in
    file=open(joe_filename,"rb")
    WaitCursor(1)
    DrawProgressBar(0.0, 'Loading JOE')
    joe=joe_obj()
    joe.load(file)
    joe.dump()
    file.close()

    ######### Creates a new mesh
    mesh = Mesh.New()

    uv_coord=[]
    uv_list=[]
    verts_extend = []
    #load the textures to use later
    #-1 if there is no texture to load
    mesh_image=load_textures(joe, texture_filename)
    if mesh_image == -1 and texture_filename:
        print 'JOE Import, Warning, texture "%s" could not load'

    if (mesh_image != -1 and texture_filename != ""):
        size=mesh_image.getSize()
        #is this really what the user wants
    #    if (size[0]!=256 or size[1]!=256):
    #        result=Blender.Draw.PupMenu("Texture map size is not 256x256, it's: "+str(size[0])+"x"+str(size[1])+": Continue?%t|Yes|No")
    #        if(result==2):
    #            Exit()
        joe.skin_width=size[0]
        joe.skin_height=size[1]
        joe.num_skins = 1


    ######### Make the verts
    DrawProgressBar(0.25,"Loading Vertex Data")
    frame = joe.frames[0]
    scale = g_scale.val
    
    def tmp_get_vertex(i):
        #use the first frame for the mesh vertices
        x=(frame.verts[i].vertices[0])*scale
        y=(frame.verts[i].vertices[1])*scale
        z=(frame.verts[i].vertices[2])*scale
        return x,y,z
    
    mesh.verts.extend( [tmp_get_vertex(i) for i in xrange(0,frame.num_vertices)] )
    del tmp_get_vertex
    
    ######## Make the UV list
    DrawProgressBar(0.50,"Loading UV Data")
    
    #w = float(joe.skin_width)
    #h = float(joe.skin_height)
    #if w <= 0.0: w = 1.0
    #if h <0>blender
    g_scale= Slider("Scale Factor: ", EVENT_NOEVENT, 10, 75, 210, 18,
                    1.0, 0.001, 10.0, 1, "Scale factor for obj Model");

    ######### Draw and Exit Buttons
    Button("Load",EVENT_LOAD_JOE , 10, 10, 80, 18)
    Button("Exit",EVENT_EXIT , 170, 10, 80, 18)

def event(evt, val):    
    if (evt == QKEY and not val):
        Blender.Draw.Exit()

def bevent(evt):
    global g_joe_filename
    global g_texture_filename
    global EVENT_NOEVENT,EVENT_LOAD_JOE,EVENT_SAVE_JOE,EVENT_EXIT

    ######### Manages GUI events
    if (evt==EVENT_EXIT):
        Blender.Draw.Exit()
    elif (evt==EVENT_CHOOSE_FILENAME):
        FileSelector(filename_callback, "JOE File Selection")
    elif (evt==EVENT_CHOOSE_TEXTURE):
        FileSelector(texture_callback, "Texture Selection")
    elif (evt==EVENT_LOAD_JOE):
        if not Blender.sys.exists(g_joe_filename.val):
            PupMenu('Model file does not exist')
            return
        else:
            #sys.stdout.flush()
            nextline = True;
            nextline2 = False;
            model = ""
            texture = ""
            list_txt=g_joe_filename.val
            dir=Blender.sys.dirname(list_txt)
            file=open(list_txt,"rb")
               for line in file.readlines():
                if line.strip() == "":
                    nextline = True
                    continue
                if nextline2 == True:
                    texture = line.strip()
                    print "Texture:", texture
                    if (Blender.sys.exists(Blender.sys.join(dir,model)) and  Blender.sys.exists(Blender.sys.join(dir,texture))):
                        load_joe(Blender.sys.join(dir,model), Blender.sys.join(dir,texture))
                    nextline2 = False
                if nextline == True and line[:1] != "#":
                    model = line.strip()
                    print "Model:", model
                    nextline = False
                    nextline2 = True
            del line
            file.close()
            Blender.Redraw()
            Blender.Draw.Exit()
            return

if __name__ == '__main__':
    Register(draw_gui, event, bevent)
Reply
11-03-2008, 09:39 PM,
#9
 
osteron, do you have a sourceforge account? I can grant you subversion access to the VDrift-art repository so you can maintain these scripts.
Reply
11-04-2008, 01:09 PM,
#10
 
I've just created a sourceforge account, but I don't know whether I will have the time ans skills to improve the scripts.
Reply
11-07-2008, 11:12 AM,
#11
 
So is your sourceforge username also osteron? I'll add you to the VDrift-art repository. If you don't have time to improve it, that's no problem.
Reply
11-09-2008, 10:46 AM,
#12
 
Yes, my username on sf is also osteron, my user id 2274924.
Reply
11-09-2008, 01:57 PM,
#13
 
Oops, I forgot, the art repository is on svn.vdrift.net. I will create an account for you, username osteron. PM me a password. I added the .py files to the following repository under tools:

http://svn.vdrift.net/repos/vdrift-art/trunk
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)