__declspec(dllexport) MStatus initializePlugin( MObject io_object )
{
	// Create a plugin function set
	MFnPlugin plugin( io_object );

	// Register the exporter
	MStatus status;
	{
		char* noIcon = "none";
		status = plugin.registerFileTranslator( s_pluginName, noIcon,
			// This function is what Maya should call to create a new instance of the mesh exporter
			eae6320::cMayaMeshExporter::Create );
		if ( !status )
		{
			MGlobal::displayError( MString( "Failed to register mesh exporter: " ) + status.errorString() );
		}
	}
    return status;
}
示例#2
0
MStatus uninitializePlugin(MObject obj)
{
	MStatus status;
	MFnPlugin plugin(obj);

	status = plugin.deregisterNode(swissArmyLocator::id);
	if (!status) {
		status.perror("deregisterNode");
		return status;
	}

	status = plugin.deregisterNode(swissArmyLocatorManip::id);
	if (!status) {
		status.perror("deregisterNode");
		return status;
	}

	return status;
}
//-*****************************************************************************
MLL_EXPORT MStatus initializePlugin( MObject obj )
{
    MStatus status;
    MFnPlugin plugin( obj, "Alembic", "1.0", "Any" );

    // H5dont_atexit();
    // H5open();

    status = plugin.registerCommand( "AlembicSimpleAbcExport",
                                     AlembicSimpleAbcExport::AbcExport::creator,
                                     AlembicSimpleAbcExport::AbcExport::createSyntax );

    if ( !status )
    {
        status.perror( "registerCommand" );
    }

    return status;
}
MStatus initializePlugin( MObject obj )
{ 
	MStatus   status = MStatus::kFailure;

	MFnPlugin plugin( obj, PLUGIN_COMPANY, "1.0", "Any");

	// Register the renderer
	//
	g_OpenGLRenderer = new OpenGLViewportRenderer();
	if (g_OpenGLRenderer)
	{
		status = g_OpenGLRenderer->registerRenderer();
		if (status != MStatus::kSuccess)
		{
			status.perror("Failed to register OpenGL renderer properly.");
		}
	}
	return status;
}
示例#5
0
MStatus initializePlugin(MObject obj){ 
	MStatus stat;
	MFnPlugin plugin(obj);

	stat = plugin.registerCommand("blurTween", BlurBetween::creator, BlurBetween::syntaxCreator);
	if (!stat){
		stat.perror("registerCommand");
		return stat;
	}


	stat = plugin.registerCommand("blurTweenUI", BlurTweenUICmd::creator);
	if (!stat){
		stat.perror("registerCommand");
		return stat;
	}

	return stat;
}
示例#6
0
void OutputMap::loadPlugins(const QDir& dir)
{
    /* Check that we can access the directory */
    if (dir.exists() == false || dir.isReadable() == false)
        return;

    /* Loop thru all files in the directory */
    QStringListIterator it(dir.entryList());
    while (it.hasNext() == true)
    {
        /* Attempt to load a plugin from the path */
        QString fileName(it.next());
        QString path = dir.absoluteFilePath(fileName);
        QPluginLoader loader(path, this);
        QLCOutPlugin* p = qobject_cast<QLCOutPlugin*> (loader.instance());
        if (p != NULL)
        {
            /* Check for duplicates */
            if (plugin(p->name()) == NULL)
            {
                /* New plugin. Append and init. */
                qDebug() << "Output plugin" << p->name() << "from" << fileName;
                p->init();
                appendPlugin(p);
                QLCi18n::loadTranslation(p->name().replace(" ", "_"));
            }
            else
            {
                /* Duplicate plugin. Unload it. */
                qWarning() << Q_FUNC_INFO << "Discarded duplicate output plugin"
                           << path;
                loader.unload();
            }
        }
        else
        {
            qWarning() << Q_FUNC_INFO << fileName
                       << "doesn't contain a QLC output plugin:"
                       << loader.errorString();
            loader.unload();
        }
    }
}
MStatus uninitializePlugin( MObject obj)
{
	MStatus   status;
	MFnPlugin plugin( obj );

	status = plugin.deregisterNode( geometrySurfaceConstraint::id );
	if (!status) {
		status.perror("deregisterNode");
		return status;
	}

	status = plugin.deregisterConstraintCommand( "geometrySurfaceConstraint" );
	if (!status) {
		status.perror("deregisterNode");
		return status;
	}

	return status;
}
示例#8
0
//! Transform the polygon to the tile referential
QcPolygon
QcMapViewLayer::transform_polygon(const QcPolygon & polygon) // Fixme: const
{
  const QcTileMatrixSet & tile_matrix_set = plugin()->tile_matrix_set();
  QcPolygon transformed_polygon;
  QList<QcVectorDouble> vertexes;
  for (const auto & vertex : polygon.vertexes()) {
    // Fixme: [before in viewport] -1 else take tile on border
    auto transformed_vertex = (vertex - tile_matrix_set.origin()) * tile_matrix_set.scale();
    vertexes << transformed_vertex;
    // transformed_polygon.add_vertex(transformed_vertex);
  }
  // Fixme: inverted y
  transformed_polygon.add_vertex(vertexes[1]);
  transformed_polygon.add_vertex(vertexes[0]);
  transformed_polygon.add_vertex(vertexes[3]);
  transformed_polygon.add_vertex(vertexes[2]);
  return transformed_polygon;
}
// SysMonPluginPropPage
LRESULT SysMonPluginPropPage::OnInitDialog(
    UINT msg, WPARAM w, LPARAM l, BOOL &bHandled) {
  int refresh_interval = 1;
  int active_monitors = ACTIVE_MON_CPU |
                        ACTIVE_MON_MEM |
                        ACTIVE_MON_DISK |
                        ACTIVE_MON_NET;
  int max_disk_rw = kDefaultMaxDiskRWInChart;
  int max_net_io = kDefaultMaxNetIOInChart;
  int auto_adjust_chart_max = kDefaultAutoAdjustChartMax;

  CComQIPtr<IGoogleDesktopSysMonPlugin> plugin(m_ppUnk[0]);
  if (plugin) {
    ATLVERIFY(SUCCEEDED(plugin->get_refresh_interval(&refresh_interval)));
    ATLVERIFY(SUCCEEDED(plugin->get_active_monitors(&active_monitors)));
    ATLVERIFY(SUCCEEDED(plugin->get_max_disk_rw_in_chart(&max_disk_rw)));
    ATLVERIFY(SUCCEEDED(plugin->get_max_net_io_in_chart(&max_net_io)));
    ATLVERIFY(SUCCEEDED(plugin->get_auto_adjust_chart_max(&auto_adjust_chart_max)));
  }

  SetDlgItemInt(IDC_EDIT_REFRESH_INTERVAL, refresh_interval, FALSE);
  SetDlgItemInt(IDC_EDIT_MAX_DISK_RW, max_disk_rw, FALSE);
  SetDlgItemInt(IDC_EDIT_MAX_NET_IO, max_net_io, FALSE);

  if (active_monitors & ACTIVE_MON_CPU)
    ::SendMessage(GetDlgItem(IDC_CHECK_CPU), BM_SETCHECK, BST_CHECKED, 0);
  if (active_monitors & ACTIVE_MON_MEM)
    ::SendMessage(GetDlgItem(IDC_CHECK_MEM), BM_SETCHECK, BST_CHECKED, 0);
  if (active_monitors & ACTIVE_MON_DISK)
    ::SendMessage(GetDlgItem(IDC_CHECK_DISK), BM_SETCHECK, BST_CHECKED, 0);
  if (active_monitors & ACTIVE_MON_NET)
    ::SendMessage(GetDlgItem(IDC_CHECK_NET), BM_SETCHECK, BST_CHECKED, 0);

  if (auto_adjust_chart_max) {
    ::SendMessage(GetDlgItem(IDC_CHECK_AUTO_MAX), BM_SETCHECK, BST_CHECKED, 0);
  }

  ::EnableWindow(GetDlgItem(IDC_EDIT_MAX_DISK_RW), !auto_adjust_chart_max);
  ::EnableWindow(GetDlgItem(IDC_EDIT_MAX_NET_IO), !auto_adjust_chart_max);

  SetDirty(FALSE);
  return 0;
}
示例#10
0
MStatus uninitializePlugin(MObject obj)
{
	MStatus status;
	MFnPlugin plugin(obj);

	status = plugin.deregisterContextCommand("componentScaleContext");
	if (!status) {
		MGlobal::displayError("Error deregistering componentScaleContext command");
		return status;
	}

	status = plugin.deregisterNode(componentScaleManip::id);
	if (!status) {
		MGlobal::displayError("Error deregistering componentScaleManip node");
		return status;
	}

	return status;
}
示例#11
0
MStatus initializePlugin( MObject obj )
{ 
	const MString	UserClassify( "shader/surface" );

	MString command( "if( `window -exists createRenderNodeWindow` ) {refreshCreateRenderNodeWindow(\"" );

	MFnPlugin plugin( obj, PLUGIN_COMPANY, "4.5", "Any" );

	CHECK_MSTATUS( plugin.registerNode( "lambertShader", lambert::id, 
			lambert::creator, lambert::initialize, MPxNode::kDependNode,
			&UserClassify ) );

   command += UserClassify;
   
   command += "\");}\n";

   CHECK_MSTATUS( MGlobal::executeCommand( command ) );

   return( MS::kSuccess );
}
示例#12
0
MStatus uninitializePlugin( MObject obj) {
  MStatus status;
  MFnPlugin plugin(obj);

#if MAYA_API_VERSION >= 201600
  status = MGPUDeformerRegistry::deregisterGPUDeformerCreator(CVWrap::kName, "cvWrapOverride");
  CHECK_MSTATUS_AND_RETURN_IT(status);
#endif
  status = plugin.deregisterCommand(CVWrapCmd::kName);
  CHECK_MSTATUS_AND_RETURN_IT(status);
  status = plugin.deregisterNode(CVWrap::id);
  CHECK_MSTATUS_AND_RETURN_IT(status);

  if (MGlobal::mayaState() == MGlobal::kInteractive) {
    MGlobal::executePythonCommandOnIdle("import cvwrap.menu");
		MGlobal::executePythonCommandOnIdle("cvwrap.menu.destroy_menuitems()");
  }
  
  return status;
}
示例#13
0
MStatus initializePlugin( MObject obj )
{ 
	MStatus   status;
	MFnPlugin plugin( obj, "Locus", "2014", "Any");

	status = plugin.registerNode( "psdJointBase", MainNode::id,
		MainNode::creator, MainNode::initialize, MainNode::kDeformerNode );
	CHECK_MSTATUS_AND_RETURN_IT( status );

	status = plugin.registerCommand( "psdJointBase_addIndex", AddIndex::creator, AddIndex::newSyntax );
	CHECK_MSTATUS_AND_RETURN_IT( status );

	status = plugin.registerCommand( "psdJointBase_deleteIndex", DeleteIndex::creator, DeleteIndex::newSyntax );
	CHECK_MSTATUS_AND_RETURN_IT( status );

	status = plugin.registerCommand( "psdJointBase_addShape", AddShape::creator, AddShape::newSyntax );
	CHECK_MSTATUS_AND_RETURN_IT( status );

	return status;
}
MStatus initializePlugin( MObject obj )
//
//	Description:
//		this method is called when the plug-in is loaded into Maya.  It 
//		registers all of the services that this plug-in provides with 
//		Maya.
//
//	Arguments:
//		obj - a handle to the plug-in object (use MFnPlugin to access it)
//
{ 
	MStatus   status;
	MFnPlugin plugin( obj, "", "2009", "Any");

	// Add plug-in feature registration here
	//
	status = plugin.registerCommand("sceneMsgCmd",sceneMsgCmd::creator);

	return status;
}
示例#15
0
bool OutputMap::appendPlugin(QLCOutPlugin* outputPlugin)
{
    Q_ASSERT(outputPlugin != NULL);

    if (plugin(outputPlugin->name()) == NULL)
    {
        m_plugins.append(outputPlugin);
        connect(outputPlugin, SIGNAL(configurationChanged()),
                this, SLOT(slotConfigurationChanged()));
        HotPlugMonitor::connectListener(outputPlugin);
        emit pluginAdded(outputPlugin->name());
        return true;
    }
    else
    {
        qWarning() << Q_FUNC_INFO << "Output plugin" << outputPlugin->name()
                   << "is already loaded. Skipping";
        return false;
    }
}
示例#16
0
MStatus uninitializePlugin( MObject obj)
//
//	Description:
//		Deregister node
//
//	Arguments:
//		obj - a handle to the plug-in object (use MFnPlugin to access it)
//
{
	MStatus   status;
	MFnPlugin plugin( obj );

	status = plugin.deregisterNode( pnTriangles::id );
	if (!status) {
		status.perror("deregisterNode");
		return status;
	}

	return status;
}
示例#17
0
文件: main.cpp 项目: kkaushalp/aphid
MStatus initializePlugin( MObject obj )
{ 
	MStatus   status;
	MFnPlugin plugin( obj, "Zhang Jian", "0.1.1", "Any");

	status = plugin.registerNode( "geometrySurfaceConstraint", geometrySurfaceConstraint::id, geometrySurfaceConstraint::creator,
		geometrySurfaceConstraint::initialize, MPxNode::kConstraintNode );
	if (!status) {
		status.perror("registerNode");
		return status;
	}

	status = plugin.registerConstraintCommand( "geometrySurfaceConstraint", geometrySurfaceConstraintCommand::creator );
	if (!status) {
		status.perror("registerConstraintCommand");
		return status;
	}

	return status;
}
示例#18
0
MStatus uninitializePlugin( MObject obj)
{
	MStatus   status;
	MFnPlugin plugin( obj );

	status = MHWRender::MDrawRegistry::deregisterDrawOverrideCreator(
		footPrint::drawDbClassification,
		footPrint::drawRegistrantId);
	if (!status) {
		status.perror("deregisterDrawOverrideCreator");
		return status;
	}

	status = plugin.deregisterNode( footPrint::id );
	if (!status) {
		status.perror("deregisterNode");
		return status;
	}
	return status;
}
示例#19
0
MStatus initializePlugin( MObject obj )
{ 
	MStatus   status;
	MFnPlugin plugin( obj, "Zhang Jian", "1.7.3 Wed Jan 15 2010", "Any");
	
	status = plugin.registerData("fluidDescData", zjFluidDescData::id,
								 zjFluidDescData::creator);
	if (!status) {
		MGlobal::displayWarning("ERROR registering fluid Desc data.");
		return status;
	}

	status = plugin.registerNode( "fluidField", fluidField::id,
							fluidField::creator, fluidField::initialize,
							MPxNode::kFieldNode
							);
	if (!status) {
		status.perror("registerNode");
		return status;
	}
	
	status = plugin.registerNode( "fluidViz", fluidViz::id, 
						 &fluidViz::creator, &fluidViz::initialize,
						 MPxNode::kLocatorNode );
	if (!status) {
		status.perror("registerNode");
		return status;
	}
	
	status = plugin.registerNode( "jetEmitter", boomEmitter::id,
							&boomEmitter::creator, &boomEmitter::initialize,
							MPxNode::kEmitterNode );
	if (!status) {
		status.perror("registerNode");
		return status;
	}
	
	MGlobal::executeCommand ( "source zFluidMenus.mel; zfluidCreateMenus;" );

	return status;
}
示例#20
0
// The unitializePlugin is called when Maya needs to unload the plugin.
// It basically does the opposite of initialize by calling
// the deregisterNode to remove it.
//
MStatus uninitializePlugin( MObject obj )
{
	MStatus   status;
	MFnPlugin plugin( obj );
	
	status = plugin.deregisterNode( HairNode::id );
	if (!status) {
		status.perror("deregisterNode");
		return status;
	}

	status = plugin.deregisterNode( HairDguideNode::id );
	if (!status) {
		status.perror("deregisterNode");
		return status;
	}
	
	status = plugin.deregisterCommand( "ZHairGuider" );
	if (!status) {
		status.perror("deregisterCommand");
		return status;
	}
	
	status = plugin.deregisterNode( curvePatchNode::id );
	if (!status) {
		status.perror("deregisterNode");
		return status;
	}
	
	status = plugin.deregisterContextCommand( "combCurveToolContext", "combCurveTool");

	status = plugin.deregisterNode( hairDeformer::id );
	if (!status) {
		status.perror("deregisterCommand");
		return status;
	}
		
	MGlobal::executeCommand("zhairRemoveMenus;");

	return status;
}
MStatus initializePlugin( MObject obj )
///////////////////////////////////////////////////////////////////////////////
//
// Description : ( public method )
//		Initializes the plugin
//
///////////////////////////////////////////////////////////////////////////////
{
	MStatus   status;
	MFnPlugin plugin( obj, "Autodesk", "8.0", "Any");

	status = plugin.registerCommand( "convertGeometryCache", 
										convertGeometryCache::creator, 
										convertGeometryCache::cmdSyntax );
	if (!status) {
		status.perror("registerCommand");
		return status;
	}

	return status;
}
MStatus initializePlugin(MObject obj)
{
	MStatus stat;
	MFnPlugin plugin(obj,"YafaRay","2011","Any");
	stat=plugin.registerCommand("testDll",testDllCmd::creator);

	if(!stat) stat.perror("register command testDll failed T_T");

	stat=plugin.registerUI("testDllCreateUI","testDllDeleteUI");
	if(!stat) stat.perror("damn, where is it?");

	stat=plugin.registerCommand("testSelectAddAttribute",testSelectAddAttribute::creator);

	if(!stat) stat.perror("register command testSelectAddAttribute failed T_T");
	//MStringArray testDllMenuFeedback;
	//testDllMenuFeedback=plugin.addMenuItem("testDllMenu","testwindow|menu39","testDll","");
	
	

	return stat;
}
示例#23
0
文件: inputmap.cpp 项目: speakman/qlc
bool InputMap::appendPlugin(QLCInPlugin* inputPlugin)
{
    Q_ASSERT(inputPlugin != NULL);

    if (plugin(inputPlugin->name()) == NULL)
    {
        m_plugins.append(inputPlugin);
        connect(inputPlugin, SIGNAL(configurationChanged()),
                this, SLOT(slotConfigurationChanged()));
        connect(inputPlugin, SIGNAL(valueChanged(quint32,quint32,uchar)),
                this, SLOT(slotValueChanged(quint32,quint32,uchar)));
        emit pluginAdded(inputPlugin->name());
        return true;
    }
    else
    {
        qWarning() << Q_FUNC_INFO << "Input plugin" << inputPlugin->name()
                   << "is already loaded. Skipping.";
        return false;
    }
}
示例#24
0
MStatus uninitializePlugin( MObject obj)
//
//	Description:
//		this method is called when the plug-in is unloaded from Maya. It 
//		deregisters all of the services that it was providing.
//
//	Arguments:
//		obj - a handle to the plug-in object (use MFnPlugin to access it)
//
{
	MStatus   status;
	MFnPlugin plugin( obj );

	status = plugin.deregisterNode( pointOnSubd::id );
	if (!status) {
		status.perror("deregisterNode");
		return status;
	}

	return status;
}
示例#25
0
static KstDataSourcePtr findPluginFor(const QString& filename, const QString& type, const QDomElement& e = QDomElement()) {
  Q3ValueList<PluginSortContainer> bestPlugins = bestPluginsForSource(filename, type);
 
  for (Q3ValueList<PluginSortContainer>::Iterator i = bestPlugins.begin(); i != bestPlugins.end(); ++i) {
    KstDataSourcePtr plugin((*i).plugin->create(qSettingsObject, filename, QString::null, e));

    if (plugin) {
      // restore tag if present
      QDomNodeList l = e.elementsByTagName("tag");
      if (l.count() > 0) {
        QDomElement e2 = l.item(0).toElement();
        if (!e2.isNull()) {
          plugin->setTag(KstObjectTag::fromString(e2.text()));
        }
      }
      return plugin;
    }
  }

  return KstDataSourcePtr();
}
示例#26
0
MStatus uninitializePlugin( MObject obj )
	//
	//	Description:
	//		this method is called when the plug-in is unloaded from Maya. It 
	//		deregisters all of the services that it was providing.
	//
	//	Arguments:
	//		obj - a handle to the plug-in object (use MFnPlugin to access it)
	//
{
	MStatus   status;
	MFnPlugin plugin( obj );

	// Add plug-in feature deregistration here
	//
	status = plugin.deregisterContextCommand(CTX_CREATOR_NAME, TEX_COMMAND_NAME);

	CHECK_MSTATUS_AND_RETURN_IT(status);

	return status;
}
示例#27
0
/*static*/ pI_bool CpInAdapterBase::AdapterImpl::CpIn_Deserialize (
    struct _CpIn* instance, pI_str data)
{

    if (instance == 0) {
        return pI_FALSE;
    }

    std::string ser_data;
    CpInAdapterBase::AdapterImpl* adapter(
        reinterpret_cast<CpInAdapterBase::AdapterImpl* > (instance->adapter_info));
    pInPtr plugin(adapter->_base->GetpIn());

    try {
        plugin->Deserialize (ser_data);
    } catch (exception::DeserializationNotSupportedException& e) {
        SET_PLUGIN_ERROR (instance, CpIn_Error_DeserializationNotSupported, e.what());
        return pI_FALSE;
    } catch (exception::DeserializationException& e) {
        SET_PLUGIN_ERROR (instance, CpIn_Error_Deserialization, e.what());
        return pI_FALSE;
    } catch (exception::MemoryException& e) {
        SET_PLUGIN_ERROR (instance, CpIn_Error_InsufficientMemory, e.what());
        return pI_FALSE;
    }

    instance->serialization_data =
        instance->plugin_runtime->CopyString (
            instance->plugin_runtime,
            (pI_str) ser_data.c_str());

    if (instance->serialization_data == 0) {
        SET_PLUGIN_ERROR (
            instance,
            CpIn_Error_InsufficientMemory,
            "CpInAdapter - failed to copy deserialization data");
    }

    return ((instance->serialization_data != 0) ? pI_TRUE : pI_FALSE);
} // /*static*/ pI_bool CpInAdapterBase::AdapterImpl::CpIn_Deserialize (...)
示例#28
0
/// \brief	This function is called once when our plugin is unloaded. We need
/// 		to tell maya which mel funcs, nodes etc we are removing.
/// \param	obj	-	a handle to the loaded plugin
/// \return	an MStatus error code
///
EXPORT MStatus uninitializePlugin( MObject obj)
{
	_LogFunctionCall("uninitializePlugin()");

	MStatus   status;
	MFnPlugin plugin( obj );

	//
	//status = plugin.deregisterNode( btSPHContext::typeId );
	//IfMErrorMsgReturn(status, "deregist btSPHContext error.", status);
	//
	////
	status = plugin.deregisterNode( btSPHNode::typeId );
	IfMErrorMsgReturn(status, "deregist btSPHNode error.", status);

	////
	//status = plugin.deregisterNode( simpleFluidEmitter::typeId );
	//IfMErrorMsgReturn(status, "deregist simpleFluidEmitter error.", status);

	////
	//status = plugin.deregisterNode( torusField::typeId );
	//IfMErrorMsgReturn(status, "deregist torusField error.", status);
	//
	//
	status = plugin.deregisterNode( particleAttrNode::typeId );
	IfMErrorMsgReturn(status, "deregist particleAttrNode error.", status);
	
	//
	status = plugin.deregisterCommand( btSPHCmd::typeName );				
	IfMErrorMsgReturn(status, "deregist btSPHCmd error.", status);
	//
	status = plugin.deregisterNode( btSPHMgrNode::typeId );
	IfMErrorMsgReturn(status, "deregist btSPHMgrNode error.", status);

	//
	MGlobal::executeCommand("source \"SPHMain.mel\"; g_btSPH_End();");

	close_logs();
	return status;
}
示例#29
0
MStatus initializePlugin( MObject obj )
{
	const MString	UserClassify( "shader/surface" );

	MGlobal::displayInfo(MString("Loading plugin MayaTo@ version: ") + MString(VERSION));
	MStatus   status;
	MFnPlugin plugin( obj, VENDOR, VERSION, "Any");

	status = plugin.registerCommand(MAYATOCMDNAME, MayaTo@::creator, MayaTo@::newSyntax );
	if (!status) {
		status.perror("cannot register command: mayato@");
		return status;
	}

	MString command( "if( `window -exists createRenderNodeWindow` ) {refreshCreateRenderNodeWindow(\"" );
	command += UserClassify;
	command += "\");}\n";
	MGlobal::executeCommand( command );

	status = plugin.registerNode(MayaTo@GlobalsName, MayaTo@Globals::id, MayaTo@Globals::creator, MayaTo@Globals::initialize );
	if (!status) {
		status.perror("cannot register node: MayaTo@Globals");
		return status;
	}

	setRendererName("@");
	setRendererShortCutName("mt@");
	setRendererHome(getenv("MT@_HOME"));

	MString cmd = MString("import mt@_initialize as minit; minit.initRenderer()");
	MGlobal::displayInfo("try to register...");
	status = MGlobal::executePythonCommand(cmd, true, false);
	if(!status)
	{
		status.perror("Problem executing cmd: mt@_initialize.initRenderer()");
		return status;
	}

	return status;
}
示例#30
0
文件: Dial.cpp 项目: Archie3d/qmusic
void Dial::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();

    m_pPropLabel = propertyManager()->addProperty(QVariant::String, "Label");
    m_pPropLabel->setValue(plugin()->name());

    m_pPropValue = propertyManager()->addProperty(QVariant::Double, "Value");
    m_pPropValue->setValue(0.0);
    m_pPropValue->setAttribute("decimals", 2);
    m_pPropValue->setAttribute("singleStep", 0.1);

    m_pPropMin = propertyManager()->addProperty(QVariant::Double, "Mininum");
    m_pPropMin->setValue(0.0);
    m_pPropMin->setAttribute("decimals", 2);
    m_pPropMin->setAttribute("signleStep", 0.1);


    m_pPropMax = propertyManager()->addProperty(QVariant::Double, "Maximum");
    m_pPropMax->setValue(1.0);
    m_pPropMax->setAttribute("decimals", 2);
    m_pPropMax->setAttribute("signleStep", 0.1);

    m_pPropSteps = propertyManager()->addProperty(QVariant::Int, "Steps");
    m_pPropSteps->setValue(10);
    m_pPropSteps->setAttribute("minimum", 2);

    QObject::connect(propertyManager(), &QtVariantPropertyManager::propertyChanged, [this](QtProperty *pProperty){
        Q_UNUSED(pProperty);
        updateDialValues();
    });

    pRoot->addSubProperty(m_pPropLabel);
    pRoot->addSubProperty(m_pPropValue);
    pRoot->addSubProperty(m_pPropMin);
    pRoot->addSubProperty(m_pPropMax);
    pRoot->addSubProperty(m_pPropSteps);

    updateDialValues();
}