MAYA插件入門

我們知道, MAYA 是一個基于結點的插件式軟件架構,這種開放式的軟件架構是非常優秀的,它可以讓用戶非常方便地在其基礎上開發一些自已想要的插件,從而實現一些特殊的功能或效果。

???????? MAYA上開發自已的插件,你有3種選擇,第一種是使用MEL語言開發腳本插件,使用MEL語言來編插件的最大優點是方便易學,MEL代碼在MAYA上直接可以運行,不用任何輔助工具,在MAYA2008之前,MAYA的整個界面都是用MEL語言來寫的,可見MEL語言也足夠的強大,但是畢竟它是一個解析型的腳本言語,而且是一種面向過程的語言,因此,當我人要實現一些高性能的,或者是一些代碼量非常大,對像關系非常復雜的功能時,MEL語言就是顯得有點力不從心。這時候,你就有了第二種選擇,基于C++語言的MAYA API插件,API插件的最大優點是高效,一般來說,用C++來寫的API插件要比MEL語言插件運行速度要快10倍以上,試想一下,你如果要對一個有100萬面的模型的每條邊逐一搜索,用MEL來做,肯定要處理很長時間,但是用C++則可以非常輕松實現,可以說,MAYA的核心就是C++OpenGL構建起來的。但是API插件,也有它的缺點,最大的缺點就是用必須要用C++編程,而C++又偏偏是公認的最難學的語言之一,很多計算機專科畢業的人對它都是一知半解,所以對于多數的美術制作人來說,也只能望而卻步了。當然,在MAYA 2008之后,我們又有了第三個選擇,那就是Python,這是一個在MELC++之間的折中選擇,Python本身它是一種腳本語言,因此它也可以和MEL一樣直接在MAYA窗口運行,而且也比較好學,同時時呢,它又擁有C++的面向對像的特性,因此呢,你可以用Python來開發足夠復雜的程序。

???????? 可見三種方案,各有所長,沒有最好,只有最適合,選用哪種方案,得視實際的需求來定奪。在這里,我詳細說一下用如何C++來編寫MAYA API插件,只為有這方面需求的朋友提供一個入門級的幫助,當然,前提是你要會C++編程。我們選用的編譯環境是Maya 2010Microsoft Visual Studio 2005,要編寫MAYA API插件就得用到MAYA的開發包,沒默認情況下,MAYA SDK會隨MAYA程序一起被安裝到相應目錄下,如:D:/Program Files/Autodesk/Maya2010/includeD:/Program Files/Autodesk/Maya2010/lib,對于入門的朋友,可以使用MAYA API插件編程向導MayaPluginWizard2.0,這個向導能快速地都你在VS2005上搭建插件編程框架。打開文件夾D:/Program Files/Autodesk/Maya2010/devkit/pluginwizard,里面有安裝說明,安步驟把MayaPluginWizard2.0.zip安裝到VS2005中去。值得注意的是Maya 2010的插件工程向導是基于VS2005的,你如果用的是VS2008或其它VS編譯器,這個向導安裝上去可能沒法正確運行,這是因為版本識別問題,你可以用記事本把文件文件MayaPluginWizard.vszMayaPluginWizard/Templates/1033/plugin.vcproj打開,把里面的8.0改為9.0,就可以在VS2008中運行了。

???????? 如果向導工具安裝成功,打開VS2005的新建工程向導,我們可以看到以下的界面

mayaWizrad.png

我們選擇MayaPluginWizard來新建一個項目:

mayaWizrad2

默認情況下,developer Kit location是指向C盤的,如果你的MAYA安裝在基它地方,則需要指定相應的MAYA安裝路徑:

mayaWizrad3

我們首先來創建一個最簡單的MAYA插件,就是一個不帶Undo/Redo功能的maya命令。

Finish之后,工程就創建好了,代碼很簡單,整個工程只有一個CPP文件,代碼如下:

?

#include <maya/MSimple.h>

DeclareSimpleCommand( sayHello, "", "2010");

MStatus sayHello::doIt( const MArgList& args )

//?? Return Value:

//?????? MS::kSuccess - command succeeded

//?????? MS::kFailure - command failed (returning this value will cause the

//??????????????????? ?MEL script that is being run to terminate unless the

//???????????????????? error is caught using a "catch" statement.

//

{

???? MStatus stat = MS::kSuccess;

???? displayInfo("Hello World!");

???? // Since this class is derived off of MPxCommand, you can use the

???? // inherited methods to return values and set error messages

???? //

???? setResult( "sayHello command executed!/n" );

???? return stat;

}

我們在doIt()函數中加入一行:displayInfo("Hello World!");

這個對于程序員來說近乎圣經般入門代碼。然后進行編譯,如果一切順利,在我們工程的Debug文件夾中就生成了一個叫sayHello.mll文件,這就是一個MAYA插件了,安裝MAYA插件也挺簡單,把sayHello.mll文件拷貝到D:/Program Files/Autodesk/Maya2010/bin/plug-ins目錄下,然后重新打開maya2010,從菜單window->settings/preferences->Plug-In Manager打開插件加載窗口:

loadPlugin

把我們的sayHello.mll插件加載進來,然后在我們的maya命令行窗口中輸入sayHello;命令對插件進行測試。

sayHelloCmd

久違的Hello World!問候最終是成功地顯示。

MAYA的插件大體上分為兩大類型,命令(Command)和結點(Node),多數情況下,命令都是為結點服務的,下面我們來說一下如何編寫一個簡單的Maya結點。那么什么maya的結點呢?我們可以把結點想像為一個數據流處理器,每個結點,它都有輸入接口,輸出接口,及對數據進行處理的內核,如圖:

node
我們說MYAY是基于結點的插件式軟件架構,所以在MAYA底層,對所有的數據都是通過把大量這的結點連接起來,一層層地進行運算和處理才得到最終的結果。這種基于結點的軟件架構,其最大的好處就是制作人員可以根據需求把各種隨意地連接起來,從而實現讓制作人員可以最大限度在發揮自已的想像空間和創意能力。

???????? 下面我們來實現一個功能簡單的結點,該結點只有一個輸入接口和一個輸出接口(注:一個結點可以有多個輸入接口和輸出接口),要實現的功能是把輸入的數據乘以0.5變成原來的一半,然后輸出。

???????? 打開MayaPluginWizard,新建一個Dependency Graph Node插件

halfScaleNode

?

?

[cpp] view plaincopyprint?
  1. // ??
  2. //?Copyright?(C)? ??
  3. //? ??
  4. //?File:?pluginMain.cpp ??
  5. // ??
  6. //?Author:?Maya?Plug-in?Wizard?2.0 ??
  7. // ??
  8. ??
  9. #include?"halfScaleNodeNode.h" ??
  10. ??
  11. #include?<maya/MFnPlugin.h> ??
  12. ??
  13. MStatus?initializePlugin(?MObject?obj?)??
  14. // ??
  15. //??Description: ??
  16. //??????this?method?is?called?when?the?plug-in?is?loaded?into?Maya.??It? ??
  17. //??????registers?all?of?the?services?that?this?plug-in?provides?with? ??
  18. //??????Maya. ??
  19. // ??
  20. //??Arguments: ??
  21. //??????obj?-?a?handle?to?the?plug-in?object?(use?MFnPlugin?to?access?it) ??
  22. // ??
  23. {???
  24. ????MStatus???status;??
  25. ????MFnPlugin?plugin(?obj,?"",?"2010",?"Any");??
  26. ??
  27. ????status?=?plugin.registerNode(?"halfScaleNode",?halfScaleNode::id,?halfScaleNode::creator,??
  28. ??????????????????????????????????halfScaleNode::initialize?);??
  29. ????if?(!status)?{??
  30. ????????status.perror("registerNode");??
  31. ????????return?status;??
  32. ????}??
  33. ??
  34. ????return?status;??
  35. }??
  36. ??
  37. MStatus?uninitializePlugin(?MObject?obj)??
  38. // ??
  39. //??Description: ??
  40. //??????this?method?is?called?when?the?plug-in?is?unloaded?from?Maya.?It? ??
  41. //??????deregisters?all?of?the?services?that?it?was?providing. ??
  42. // ??
  43. //??Arguments: ??
  44. //??????obj?-?a?handle?to?the?plug-in?object?(use?MFnPlugin?to?access?it) ??
  45. // ??
  46. {??
  47. ????MStatus???status;??
  48. ????MFnPlugin?plugin(?obj?);??
  49. ??
  50. ????status?=?plugin.deregisterNode(?halfScaleNode::id?);??
  51. ????if?(!status)?{??
  52. ????????status.perror("deregisterNode");??
  53. ????????return?status;??
  54. ????}??
  55. ??
  56. ????return?status;??
  57. }??


?

halfScaleNodeNode.h

[cpp] view plaincopyprint?
  1. #ifndef?_halfScaleNodeNode ??
  2. #define?_halfScaleNodeNode ??
  3. // ??
  4. //?Copyright?(C)? ??
  5. //? ??
  6. //?File:?halfScaleNodeNode.h ??
  7. // ??
  8. //?Dependency?Graph?Node:?halfScaleNode ??
  9. // ??
  10. //?Author:?Maya?Plug-in?Wizard?2.0 ??
  11. // ??
  12. ??
  13. #include?<maya/MPxNode.h> ??
  14. #include?<maya/MFnNumericAttribute.h> ??
  15. #include?<maya/MTypeId.h>? ??
  16. ??
  17. ???
  18. class?halfScaleNode?:?public?MPxNode??
  19. {??
  20. public:??
  21. ????????????????????????halfScaleNode();??
  22. ????virtual?????????????~halfScaleNode();???
  23. ??
  24. ????virtual?MStatus?????compute(?const?MPlug&?plug,?MDataBlock&?data?);??
  25. ??
  26. ????static??void*???????creator();??
  27. ????static??MStatus?????initialize();??
  28. ??
  29. public:??
  30. ??
  31. ????//?There?needs?to?be?a?MObject?handle?declared?for?each?attribute?that ??
  32. ????//?the?node?will?have.??These?handles?are?needed?for?getting?and?setting ??
  33. ????//?the?values?later. ??
  34. ????// ??
  35. ????static??MObject?????input;??????//?Example?input?attribute ??
  36. ????static??MObject?????output;?????//?Example?output?attribute ??
  37. ??
  38. ??
  39. ????//?The?typeid?is?a?unique?32bit?indentifier?that?describes?this?node. ??
  40. ????//?It?is?used?to?save?and?retrieve?nodes?of?this?type?from?the?binary ??
  41. ????//?file?format.??If?it?is?not?unique,?it?will?cause?file?IO?problems. ??
  42. ????// ??
  43. ????static??MTypeId?????id;??
  44. };??
  45. ??
  46. #endif??


?

halfScaleNodeNode.cpp

?

[cpp] view plaincopyprint?
  1. // ??
  2. //?Copyright?(C)? ??
  3. //? ??
  4. //?File:?halfScaleNodeNode.cpp ??
  5. // ??
  6. //?Dependency?Graph?Node:?halfScaleNode ??
  7. // ??
  8. //?Author:?Maya?Plug-in?Wizard?2.0 ??
  9. // ??
  10. ??
  11. #include?"halfScaleNodeNode.h" ??
  12. ??
  13. #include?<maya/MPlug.h> ??
  14. #include?<maya/MDataBlock.h> ??
  15. #include?<maya/MDataHandle.h> ??
  16. ??
  17. #include?<maya/MGlobal.h> ??
  18. ??
  19. //?You?MUST?change?this?to?a?unique?value!!!??The?id?is?a?32bit?value?used ??
  20. //?to?identify?this?type?of?node?in?the?binary?file?format.?? ??
  21. // ??
  22. //#error?change?the?following?to?a?unique?value?and?then?erase?this?line? ??
  23. MTypeId?????halfScaleNode::id(?0x02010?);??
  24. ??
  25. //?Example?attributes ??
  26. //? ??
  27. MObject?????halfScaleNode::input;??????????
  28. MObject?????halfScaleNode::output;?????????
  29. ??
  30. halfScaleNode::halfScaleNode()?{}??
  31. halfScaleNode::~halfScaleNode()?{}??
  32. ??
  33. MStatus?halfScaleNode::compute(?const?MPlug&?plug,?MDataBlock&?data?)??
  34. // ??
  35. //??Description: ??
  36. //??????This?method?computes?the?value?of?the?given?output?plug?based ??
  37. //??????on?the?values?of?the?input?attributes. ??
  38. // ??
  39. //??Arguments: ??
  40. //??????plug?-?the?plug?to?compute ??
  41. //??????data?-?object?that?provides?access?to?the?attributes?for?this?node ??
  42. // ??
  43. {??
  44. ????MStatus?returnStatus;??
  45. ???
  46. ????//?Check?which?output?attribute?we?have?been?asked?to?compute.??If?this? ??
  47. ????//?node?doesn't?know?how?to?compute?it,?we?must?return? ??
  48. ????//?MS::kUnknownParameter. ??
  49. ????//? ??
  50. ????if(?plug?==?output?)??
  51. ????{??
  52. ????????//?Get?a?handle?to?the?input?attribute?that?we?will?need?for?the ??
  53. ????????//?computation.??If?the?value?is?being?supplied?via?a?connection? ??
  54. ????????//?in?the?dependency?graph,?then?this?call?will?cause?all?upstream?? ??
  55. ????????//?connections?to?be?evaluated?so?that?the?correct?value?is?supplied. ??
  56. ????????//? ??
  57. ????????MDataHandle?inputData?=?data.inputValue(?input,?&returnStatus?);??
  58. ??
  59. ????????if(?returnStatus?!=?MS::kSuccess?)??
  60. ????????????MGlobal::displayError(?"Node?halfScaleNode?cannot?get?value\n"?);??
  61. ????????else??
  62. ????????{??
  63. ????????????//?Read?the?input?value?from?the?handle. ??
  64. ????????????// ??
  65. ????????????float?result?=?inputData.asFloat();??
  66. ????????????result?*=?0.5;??
  67. ????????????//?Get?a?handle?to?the?output?attribute.??This?is?similar?to?the ??
  68. ????????????//?"inputValue"?call?above?except?that?no?dependency?graph? ??
  69. ????????????//?computation?will?be?done?as?a?result?of?this?call. ??
  70. ????????????//? ??
  71. ????????????MDataHandle?outputHandle?=?data.outputValue(?halfScaleNode::output?);??
  72. ????????????//?This?just?copies?the?input?value?through?to?the?output.?? ??
  73. ????????????//? ??
  74. ????????????outputHandle.set(?result?);??
  75. ????????????//?Mark?the?destination?plug?as?being?clean.??This?will?prevent?the ??
  76. ????????????//?dependency?graph?from?repeating?this?calculation?until?an?input? ??
  77. ????????????//?of?this?node?changes. ??
  78. ????????????//? ??
  79. ????????????data.setClean(plug);??
  80. ????????}??
  81. ????}?else?{??
  82. ????????return?MS::kUnknownParameter;??
  83. ????}??
  84. ??
  85. ????return?MS::kSuccess;??
  86. }??
  87. ??
  88. void*?halfScaleNode::creator()??
  89. // ??
  90. //??Description: ??
  91. //??????this?method?exists?to?give?Maya?a?way?to?create?new?objects ??
  92. //??????of?this?type.? ??
  93. // ??
  94. //??Return?Value: ??
  95. //??????a?new?object?of?this?type ??
  96. // ??
  97. {??
  98. ????return?new?halfScaleNode();??
  99. }??
  100. ??
  101. MStatus?halfScaleNode::initialize()??
  102. // ??
  103. //??Description: ??
  104. //??????This?method?is?called?to?create?and?initialize?all?of?the?attributes ??
  105. //??????and?attribute?dependencies?for?this?node?type.??This?is?only?called? ??
  106. //??????once?when?the?node?type?is?registered?with?Maya. ??
  107. // ??
  108. //??Return?Values: ??
  109. //??????MS::kSuccess ??
  110. //??????MS::kFailure ??
  111. //?????? ??
  112. {??
  113. ????//?This?sample?creates?a?single?input?float?attribute?and?a?single ??
  114. ????//?output?float?attribute. ??
  115. ????// ??
  116. ????MFnNumericAttribute?nAttr;??
  117. ????MStatus?????????????stat;??
  118. ??
  119. ????input?=?nAttr.create(?"input",?"in",?MFnNumericData::kFloat,?0.0?);??
  120. ????//?Attribute?will?be?written?to?files?when?this?type?of?node?is?stored ??
  121. ????nAttr.setStorable(true);??
  122. ????//?Attribute?is?keyable?and?will?show?up?in?the?channel?box ??
  123. ????nAttr.setKeyable(true);??
  124. ??
  125. ????output?=?nAttr.create(?"output",?"out",?MFnNumericData::kFloat,?0.0?);??
  126. ????//?Attribute?is?read-only?because?it?is?an?output?attribute ??
  127. ????nAttr.setWritable(false);??
  128. ????//?Attribute?will?not?be?written?to?files?when?this?type?of?node?is?stored ??
  129. ????nAttr.setStorable(false);??
  130. ??
  131. ????//?Add?the?attributes?we?have?created?to?the?node ??
  132. ????// ??
  133. ????stat?=?addAttribute(?input?);??
  134. ????????if?(!stat)?{?stat.perror("addAttribute");?return?stat;}??
  135. ????stat?=?addAttribute(?output?);??
  136. ????????if?(!stat)?{?stat.perror("addAttribute");?return?stat;}??
  137. ??
  138. ????//?Set?up?a?dependency?between?the?input?and?the?output.??This?will?cause ??
  139. ????//?the?output?to?be?marked?dirty?when?the?input?changes.??The?output?will ??
  140. ????//?then?be?recomputed?the?next?time?the?value?of?the?output?is?requested. ??
  141. ????// ??
  142. ????stat?=?attributeAffects(?input,?output?);??
  143. ????????if?(!stat)?{?stat.perror("attributeAffects");?return?stat;}??
  144. ??
  145. ????return?MS::kSuccess;??
  146. ??
  147. }??


?

?

我們可以看到,現在的工程代碼比剛才的命令插件要復雜多了,除了有對應的halfScaleNode.cpphalfScaleNode.h文件之外,還有一個pluginMain.cpp文件,這是每個MAYA插件的入口,MAYA在加載該結點的時候,會自動運行initializePlugin( MObject obj )函數,因此我們就可以在這里做一些初始化的操作,其中最重要的就是要注冊這個maya結點。

status = plugin.registerNode( "halfScaleNode", halfScaleNode::id, halfScaleNode::creator,

???????????????????????????????????? ? halfScaleNode::initialize );

if (!status) {

???? status.perror("registerNode");

???? return status;

}

所有自定義的maya結點及命令,都必須在初始化的時候注冊,才能被MAYA識別和使用。注冊的時候我們要注意的是,新的結點名和結點ID不能與已有的結點沖突,也就是說結點名和結點ID在整個MAYA系統中都必須是唯一的。所以在halfScaleNodeNode.cpp文件的開始有這樣一個定義結點ID的代碼

// You MUST change this to a unique value!!!? The id is a 32bit value used

// to identify this type of node in the binary file format.?

#error change the following to a unique value and then erase this line

MTypeId???? halfScaleNode::id( 0x00001 );

這里就提示我們必須要給該結點分配一個唯一的ID,要不就沒法通過編譯。我們可以把以上代碼改為

//#error change the following to a unique value and then erase this line

MTypeId???? halfScaleNode::id( 0x02010 );

這樣我們就可以正常地編譯代碼了。

?

接下來我們來詳細說一下每個結點的核心運算函數:compute( const MPlug& plug, MDataBlock& data );前面我們說過,一個結點是由輸入接口、輸出接口及運算核心組成,這里的運算核心就是compute()函數,而輸入輸出接口則被封裝在MDataBlock& data這個對像里面,我們通過相應的函數,就可以取得輸入口和輸出口所對應的地址,然后對這些數據進行操作:

MDataHandle inputData = data.inputValue( input, &returnStatus );

MDataHandle outputHandle = data.outputValue( halfScaleNode::output );

?

float result = inputData.asFloat();

這里,result所得到的就是輸入數據的原始值,如果我們不作任何運算,直接把它賦值給輸出接口

outputHandle.set( result );

那么得到的輸出結果,也不會有任何改變。現在我們把輸入數據乘以0.5然后再賦給輸出接口:

float result = inputData.asFloat();

result = result * 0.5;

outputHandle.set( result );

很容易地,我們就達到了我們所想要實現的功能。把工程編譯一下,得到一個叫halfScaleNode.mllMAYA插件,和前面所說的安裝方式一樣,我們把halfScaleNode.mll拷貝到plug-in文件夾中,然后在MAYA插件管理器中加載該插件。

我們來驗檢一下該結點插件是否能正確運行。我們要在maya場景中建兩個小球,在命令窗口中輸入并運行以下mel代碼:

polySphere;

createNode halfScaleNode;

connectAttr halfScaleNode1.output pSphere2.translateX;

scenescene2

?

hypergraph

從超圖上我們可以后清晰地看到,pSphere1translateX屬性被連接到halfScaleNode1input輸入口,經過運算后,輸出給pSphere2translateX屬性。現在我們選擇pSphere1然后沿X軸平稱,我們可以看到,pSphere2會跟隨pSphere1一起移動,但總是慢半拍,這正是我們想要的效果。

???? 這樣,一個簡單的MAYA插件也就完成了。從上面的操作,我們也可以看到,一般一就,單獨一個MAYA結點,如果用手工,是很難被正確連接起來的,所以多數情況下,結點插件都會結合mel腳本或API命令來一起使用。

???? 以上,只是簡單地介紹了編寫MAYA API插件的入門知識,在實際應用中,一個MAYA API插件要比這個復雜得多,一個MAYA結點,它可以包括多個接口,而每個接口可以是各種類型的參數,如,浮點、整型、向量、矩陣等等,甚至可以是一個mesh對像或是一個二維數組。這些,我們都可以在每個結點的initialize()函數中生成和指定。

???? 為了管理上的方便,我們可以在一個MAYA API插件中包含多個結點和命令,也就是說一個mll文件中可能有多個nodecommand,我們只要把它們都在pluginMain.cpp中的MStatus initializePlugin( MObject obj )函數進行注冊就可以了。

有問題可以給我發郵件 huawenguang@sina.com 歡迎交流。

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/388661.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/388661.shtml
英文地址,請注明出處:http://en.pswp.cn/news/388661.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

(原創) 如何使用C++/CLI讀/寫jpg檔? (.NET) (C++/CLI) (GDI+) (C/C++) (Image Processing)

Abstract因為Computer Vision的作業&#xff0c;之前都是用C# GDI寫&#xff0c;但這次的作業要做Grayscale Dilation&#xff0c;想用STL的Generic Algorithm寫&#xff0c;但C Standard Library并無法讀取jpg檔&#xff0c;用其它Library又比較麻煩&#xff0c;所以又回頭想…

貓眼電影評論_電影的人群意見和評論家的意見一樣好嗎?

貓眼電影評論Ryan Bellgardt’s 2018 movie, The Jurassic Games, tells the story of ten death row inmates who must compete for survival in a virtual reality game where they not only fight each other but must also fight dinosaurs which can kill them both in th…

128.Two Sum

題目&#xff1a; Given an array of integers, return indices of the two numbers such that they add up to a specific target. 給定一個整數數組&#xff0c;返回兩個數字的索引&#xff0c;使它們相加到特定目標。 You may assume that each input would have exactly on…

php獲取錯誤信息函數,關于php:如何獲取mail()函數的錯誤消息?

我一直在使用PHP mail()函數。如果郵件由于任何原因未發送&#xff0c;我想回顯錯誤消息。 我該怎么做&#xff1f;就像是$this_mail mail(exampleexample.com, My Subject, $message);if($this_mail) echo sent!;else echo error_message;謝謝&#xff01;當mail()返回false時…

關于夏季及雷雨天氣的MODEM、路由器使用注意事項

每年夏季是雷雨多發季節&#xff0c;容易出現家用電腦因而雷擊造成電腦硬件的損壞和通訊故障&#xff0c;為了避免這種情況的的發生&#xff0c;保護您的財產不受損失&#xff08;一般雷擊照成損壞的設備是沒得保修的&#xff09;&#xff0c;建議您繼續閱讀下面內容&#xff1…

創建Console應用程序,粘貼一下代碼,創建E://MyWebServerRoot//目錄,作為虛擬目錄,親自測試通過,

創建Console應用程序&#xff0c;粘貼一下代碼&#xff0c;創建E://MyWebServerRoot//目錄&#xff0c;作為虛擬目錄&#xff0c;親自測試通過&#xff0c; 有一個想法&#xff0c;調用ASP.DLL解析ASP&#xff0c;可是始終沒有找到資料&#xff0c;有待于研究&#xff0c;還有…

c#對文件的讀寫

最近需要對一個文件進行數量的分割&#xff0c;因為數據量龐大&#xff0c;所以就想到了通過寫程序來處理。將代碼貼出來以備以后使用。 //讀取文件的內容 放置于StringBuilder 中 StreamReader sr new StreamReader(path, Encoding.Default); String line; StringBuilder sb …

php表格tr,jQuery+ajax實現動態添加表格tr td功能示例

本文實例講述了jQueryajax實現動態添加表格tr td功能。分享給大家供大家參考&#xff0c;具體如下&#xff1a;功能&#xff1a;ajax獲取后臺返回數據給table動態添加tr/tdhtml部分&#xff1a;ajax部分&#xff1a;var year $(#year).val();//下拉框數據var province $(#prov…

maya的簡單使用

1、導出obj類型文件window - settings preferences - plug- in Manager objExport.mllfile - export selection就有OBJ選項了窗口-設置/首選項- 插件管理 objExport.mll文件-導出當前選擇2、合并元素在文件下面的下拉框&#xff0c;選擇多邊形。按住shift鍵&…

ai前沿公司_美術是AI的下一個前沿嗎?

ai前沿公司In 1950, Alan Turing developed the Turing Test as a test of a machine’s ability to display human-like intelligent behavior. In his prolific paper, he posed the following questions:1950年&#xff0c;阿蘭圖靈開發的圖靈測試作為一臺機器的顯示類似人類…

查看修改swap空間大小

查看swap 空間大小(總計)&#xff1a; # free -m 默認單位為k, -m 單位為M   total used free shared buffers cached  Mem: 377 180 197 0 19 110  -/ buffers/ca…

關于WKWebView高度的問題的解決

關于WKWebView高度的問題的解決 IOS端嵌入網頁的方式有兩種UIWebView和WKWebView。其中WKWebView的性能要高些;WKWebView的使用也相對簡單 WKWebView在加載完成后&#xff0c;在相應的代理里面獲取其內容高度&#xff0c;大多數網上的方法在獲取高度是會出現一定的問題&#xf…

測試nignx php請求并發數,nginx 優化(突破十萬并發)

一般來說nginx 配置文件中對優化比較有作用的為以下幾項&#xff1a;worker_processes 8;nginx 進程數&#xff0c;建議按照cpu 數目來指定&#xff0c;一般為它的倍數。worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;為每個進…

多米諾骨牌v.1MEL語言

// // //Script Name:多米諾骨牌v.1 //Author:瘋狂小豬 //Last Updated: 2011.10.5 //Email:wzybwj163.com // //---------------------------------------------------------------------------- //-----------------------------------------------------------------…

THINKPHP3.2視頻教程

http://edu.51cto.com/lesson/id-24504.html lunix視頻教程 http://bbs.lampbrother.net/read-htm-tid-161465.html TP資料http://pan.baidu.com/s/1dDCLFRr#path%252Fthink 微信開發&#xff0c;任務吧&#xff0c;留著記號了

mardown 標題帶數字_標題中帶有數字的故事更成功嗎?

mardown 標題帶數字統計 (Statistics) I have read a few stories on Medium about writing advice, and there were some of them which, along with other tips, suggested that putting numbers in your story’s title will increase the number of views, as people tend …

897. 遞增順序查找樹-未解決

897. 遞增順序查找樹 https://leetcode-cn.com/contest/weekly-contest-100/problems/increasing-order-search-tree/ package com.test;import java.util.ArrayList; import java.util.Collections; import java.util.List;/*** author stono* date 2018/9/2* 897. 遞增順序查…

Azure PowerShell (16) 并行開關機Azure ARM VM

《Windows Azure Platform 系列文章目錄》 并行開機腳本&#xff1a; https://github.com/leizhang1984/AzureChinaPowerShell/blob/master/ARM/2StartAzureARMVM/StartAzureRMVM.txt 并行關機腳本&#xff1a; https://github.com/leizhang1984/AzureChinaPowerShell/blob/mas…

使用Pandas 1.1.0進行穩健的2個DataFrames驗證

Pandas is one of the most used Python library for both data scientist and data engineers. Today, I want to share some Python tips to help us do qualification checks between 2 Dataframes.Pandas是數據科學家和數據工程師最常用的Python庫之一。 今天&#xff0c;我…

Maya開發

Maya開發&#xff08;一&#xff09;-- 緒論 &#xff08;翻譯自Maya官方文檔&#xff09;2008-05-09 15:33 緒論 Autodesk Maya 是一個開放的產品,就是說任何Autodesk以外的人都可以改變Maya現有的特征,或者 增加新的特性.你可以用兩個方法來修改MAYA: ME…