Exemple #1
0
// OpenUI():
//  Opens the user interface.  Returns after the panel has been closed.
bool Nullify_Interface::OpenUI() {
  // Destroy the panel if it hasn't been destroyed yet
  if( panel != NULL ) {
    (*xpanels->destroy)( panel );
    panel = NULL;
  }

  // Create the control array
  static LWXPanelControl controls[] = {
    { NUI_ABOUT,               "About",                       "vButton"  },
    { NUI_PREFIX,              "Prefix With",                 "string"   },
    { NUI_SUFFIX,              "Suffix With",                 "string"   },
    { NUI_NULLIFY_DECENDANTS,  "Nullify Decendants",          "iBoolean" },
    { NUI_REMOVE_BONES,        "Remove Bones",                "iBoolean" },
    { NUI_DISABLE_SHADOWS,     "Disable Shadow Options",      "iBoolean" },
    { NUI_STORE_ORIGINAL_NAME, "Store Original Names",        "iBoolean" },
    { NUI_REMOVE_MORPH_MIXER,  "Remove Morph Mixer",          "iBoolean" },
    { 0 } };

  // Create the data array
  static LWXPanelDataDesc data[] = {
    { NUI_ABOUT,               "About",                       ""        },
    { NUI_PREFIX,              "Prefix With",                 "string"  },
    { NUI_SUFFIX,              "Suffix With",                 "string"  },
    { NUI_NULLIFY_DECENDANTS,  "Nullify Decendants",          "integer" },
    { NUI_REMOVE_BONES,        "Remove Bones",                "integer" },
    { NUI_DISABLE_SHADOWS ,    "Disable Shadow Options",      "integer" },
    { NUI_STORE_ORIGINAL_NAME, "Store Original Names",        "integer" },
    { NUI_REMOVE_MORPH_MIXER,  "Remove Morph Mixer",          "integer" },
    { 0 } };

  // Panel Hints Array
  char title_string[256];
  sprintf( title_string, "Nullify -- %c2000-2001 Joe Angell, TM Productions", 169 );
  static LWXPanelHint panel_hints[] = {
    XpLABEL( 0, title_string ),
    XpGROUP_( NUI_GROUP_NAME ),
      XpH( NUI_PREFIX ),
      XpH( NUI_SUFFIX ),
      XpH( 0 ),

    XpGROUP_( NUI_GROUP_OPTIONS ),
      XpH( NUI_NULLIFY_DECENDANTS ),
      XpH( NUI_REMOVE_BONES ),
      XpH( NUI_DISABLE_SHADOWS ),
      XpH( NUI_REMOVE_MORPH_MIXER ),
      XpH( 0 ),

    XpBUTNOTIFY( NUI_ABOUT, HandleAbout ),

    XpEND };

  // Get XPanels
  xpanels = (LWXPanelFuncs *)global( LWXPANELFUNCS_GLOBAL, GFUSE_TRANSIENT );
  if( xpanels == NULL ) {
    retval = AFUNC_BADGLOBAL;
    return false;
  }

  // Create the Panel
  panel = (*xpanels->create)( LWXP_FORM, controls );
  if( panel == NULL ) {
    (*message->error)( "Nullify Error: Unable to create XPanels interface", NULL );
    is_ok = false;
    return false;
  }

  // Set up other panel data
  (*xpanels->describe)( panel, data, NULL, NULL );
  (*xpanels->hint)( panel, 0, panel_hints );

  // Set up initial values for the panel
  (*xpanels->formSet)( panel, NUI_PREFIX, prefix );
  (*xpanels->formSet)( panel, NUI_SUFFIX, suffix );
  FSETINT( xpanels, panel, NUI_NULLIFY_DECENDANTS,  (nullify_decendants  ? 1 : 0) );
  FSETINT( xpanels, panel, NUI_REMOVE_BONES,        (remove_bones        ? 1 : 0) );
  FSETINT( xpanels, panel, NUI_DISABLE_SHADOWS,     (disable_shadows     ? 1 : 0) );
  FSETINT( xpanels, panel, NUI_STORE_ORIGINAL_NAME, (store_original_name ? 1 : 0) );
  FSETINT( xpanels, panel, NUI_REMOVE_MORPH_MIXER,  (remove_morph_mixer  ? 1 : 0) );

  // Open the panel
  if( (*xpanels->post)( panel ) != 1 )  { // User Cancel
    user_abort = true;
    return false;
  }

  return IsOK();
}
Exemple #2
0
// OpenUI():
//  Opens the user interface.  Returns after the panel has been closed.
bool ObjectShadowOptions_Interface::OpenUI() {
  // Destroy the panel if it hasn't been destroyed yet
  if( panel != NULL ) {
    (*xpanels->destroy)( panel );
    panel = NULL;
  }

  // Create the control array
  static LWXPanelControl controls[] = {
    { OUI_ABOUT,               "About",                       "vButton"    },
    { OUI_LIMIT_TO,            "Limit To",                    "iPopChoice" },
    { OUI_MATCH_TOGGLE,        "Match Name",                  "iBoolean"   },
    { OUI_MATCH_STRING,          "Name Contains",               "string"     },
    { OUI_SELF_SHADOW,         "Self Shadow",                 "iBoolean"   },
    { OUI_CAST_SHADOW,         "Cast Shadow",                 "iBoolean"   },
    { OUI_RECEIVE_SHADOW,      "Receive Shadow",              "iBoolean"   },
    { OUI_UNSEEN_BY_RAYS,      "Unseen By Rays",              "iBoolean"   },
    { OUI_UNSEEN_BY_CAMERA,    "Unseen By Camera",            "iBoolean"   },
    { 0 } };

  // Create the data array
  static LWXPanelDataDesc data[] = {
    { OUI_ABOUT,               "About",                       ""           },
    { OUI_LIMIT_TO,            "Limit To",                    "integer"    },
    { OUI_MATCH_TOGGLE,        "Match Name",                  "integer"    },
    { OUI_MATCH_STRING,          "Name Contains",               "string"     },
    { OUI_SELF_SHADOW,         "Self Shadow",                 "integer"    },
    { OUI_CAST_SHADOW,         "Cast Shadow",                 "integer"    },
    { OUI_RECEIVE_SHADOW,      "Receive Shadow",              "integer"    },
    { OUI_UNSEEN_BY_RAYS,      "Unseen By Rays",              "integer"    },
    { OUI_UNSEEN_BY_CAMERA,    "Unseen By Camera",            "integer"    },
    { 0 } };

  // Panel Hints Array
  char title_string[256];
  sprintf( title_string, "ObjectShadowOptions -- %c2001 Foundation Imaging, written by Joe Angell", 169 );
  static LWXPanelHint panel_hints[] = {
    XpLABEL( 0, title_string ),

    XpGROUP_( OUI_GROUP_LIMIT ),
      XpH( OUI_LIMIT_TO ),
      XpH( 0 ),

    XpGROUP_( OUI_GROUP_MATCH ),
      XpH( OUI_MATCH_TOGGLE ),
      XpH( OUI_MATCH_STRING ),
      XpH(0),
    
    XpGROUP_( OUI_GROUP_SHADOW ),
      XpH( OUI_SELF_SHADOW ),
      XpH( OUI_CAST_SHADOW ),
      XpH( OUI_RECEIVE_SHADOW ),
      XpH( 0 ),

    XpGROUP_( OUI_GROUP_RENDER ),
      XpH( OUI_UNSEEN_BY_RAYS ),
      XpH( OUI_UNSEEN_BY_CAMERA ),
      XpH( 0 ),

    XpBUTNOTIFY( OUI_ABOUT, HandleAbout ),

    XpPOPFUNCS(  OUI_LIMIT_TO, LimitCount, LimitName ),

    XpENABLE_( OUI_MATCH_TOGGLE ),
      XpH( OUI_MATCH_STRING ),
      XpH( 0 ),

    XpEND };

  // Get XPanels
  xpanels = (LWXPanelFuncs *)global( LWXPANELFUNCS_GLOBAL, GFUSE_TRANSIENT );
  if( xpanels == NULL ) {
    retval = AFUNC_BADGLOBAL;
    return false;
  }

  // Create the Panel
  panel = (*xpanels->create)( LWXP_FORM, controls );
  if( panel == NULL ) {
    (*message->error)( "Nullify Error: Unable to create XPanels interface", NULL );
    is_ok = false;
    return false;
  }

  // Set up other panel data
  (*xpanels->describe)( panel, data, NULL, NULL );
  (*xpanels->hint)( panel, 0, panel_hints );

  // Set up initial values for the panel
  FSETINT( xpanels, panel, OUI_LIMIT_TO,         limit_to         );
  FSETINT( xpanels, panel, OUI_MATCH_TOGGLE,     match_toggle     );
  FSETINT( xpanels, panel, OUI_SELF_SHADOW,      self_shadow      );
  FSETINT( xpanels, panel, OUI_RECEIVE_SHADOW,   receive_shadow   );
  FSETINT( xpanels, panel, OUI_CAST_SHADOW,      cast_shadow      );
  FSETINT( xpanels, panel, OUI_UNSEEN_BY_CAMERA, unseen_by_camera );
  FSETINT( xpanels, panel, OUI_UNSEEN_BY_RAYS,   unseen_by_rays   );

  (*xpanels->formSet)( panel, OUI_MATCH_STRING, match_string );

  // Open the panel
  if( (*xpanels->post)( panel ) != 1 )  { // User Cancel
    user_abort = true;
    return false;
  }

  return IsOK();
}