* サンプルコード [#nf978271]

> エクスプレッション、オートメーションのサンプルコードを投稿するページです。

> ''投稿者の方へ''&br;
投稿時は、下記の書式に従って記述して下さい。&br;
~#code(言語名){{
~//ここにコードを記述
~}}
&br;
言語名に関しては、オートメーション、エクスプレッションはcsharp、プロパティスクリプトはpropertyscriptとしてください。
&br;&br;
また、長いコードは&br;
~#code(言語名, コード)
&br;&br;
の様に言語名の後に適当な名前を指定するとコードを折りたたむことが出来ます。&br;
&br;
※投稿時にはコード種別(オートメーションなのかエクスプレッションなのか、プロパティスクリプトなのか)を明示するようにして下さい。&br;
※オートメーションの場合は「保存」でテキスト形式で保存し、そのテキストファイルの内容をそのまま貼り付けて下さい。&br;
※エクスプレッションの場合は「エクスプレッションの保存」でテキスト形式で保存し、そのテキストファイルの内容をそのまま貼り付けて下さい。&br;

> ''投稿されたコードを使用しようと考えている方へ''&br;
エクスプレッション、オートメーションは、ある程度NiVEの操作に慣れている方用の機能です。&br;
これらの使用方法については、付属の「エクスプレッション・オートメーションについて.pdf」をご覧下さい。&br;
&br;
※オートメーションの場合は、コードをメモ帳にコピーして、文字コードを「UTF-8」にして保存し、&br;
  オートメーションの「読み込み」からそのテキストファイルを開き、実行します。&br;
※エクスプレッションの場合は、コードをメモ帳にコピーして、文字コードを「UTF-8」にして保存し、&br;
  「エクスプレッションの読み込み」からそのテキストファイルを開き、実行します。&br;
&br;
また、質問に関しては、言語に関する質問や、コードの書き方等、投稿されたコードに関係ない質問はご遠慮下さい。&br;
&br;
#article_kcaptcha
**FtXRnDrLhGrS
>[[Delonte]] (2013-08-14 (水) 06:38:20)~
~
<a href="http://www.leadingautoinsurers.net/">cheapest car insurances</a> 034 <a href="http://www.autoinsurpolicy.com/">car insurance catagories</a> 7257 <a href="http://www.qualityskincare.net/">accutane and irritable bowel syndrome</a> %-D <a href="http://wotarmory.com/">cheap viagra with mastercard</a> %-P <a href="http://www.cheappillsfored.com/">purchase cialis online</a> >:OO~
~

//

#comment_kcaptcha

**kKlwJiMaMDWlwiQmRiA
>[[Takeo]] (2013-08-06 (火) 23:56:23)~
~
<a href="http://sandiegoinsuranceonline.net/">primecare insurance San Diego</a> :-((( <a href="http://www.mybestonlinecollege.net/">online college</a> 8]] <a href="http://www.leadingautoinsurers.net/">list of cheap auto insurance in south jersey</a> 9779 <a href="http://www.comparequotesonline.net/">cheap insurance</a> 9286 <a href="http://www.buyautocoveronline.com/cheap-auto-insurance-OH.html">Ohio cheap auto insurance</a> 244 <a href="http://www.leadingautoinsurers.net/auto-insurance-quotes-utah.html">car insurance</a> =-[[[ <a href="http://www.mycarinsuranceprovider.com/cheap-car-insurance-burlington.html">auto insurance finding</a> >:(~
~

//

#comment_kcaptcha

**NCnSkWSbPXzArQ
>[[Melia]] (2013-08-01 (木) 09:56:46)~
~
<a href="http://www.leadingautoinsurers.net/auto-insurance-quotes-california.html">California auto insurance murray</a> ygp <a href="http://nycarinsuranceonline.com/">free auto insurance quotes online</a> 35266 <a href="http://www.leadingautoinsurers.net/auto-insurance-quotes-pennsylvania.html">auto insurance quotes Philadelphia</a> %OO <a href="http://www.leadingautoinsurers.net/auto-insurance-quotes-louisiana.html">free online car insurance quotes</a> 11879 <a href="http://www.lowpricetreatment.com/">cheap cialis generic</a> ychpj <a href="http://www.cheappillsfored.com/">where to buy cialis</a> msrvvz~
~

//

#comment_kcaptcha

**UpeJXlimUCZSjpMv
>[[Boog]] (2013-07-30 (火) 09:46:23)~
~
<a href="http://www.eddrugsoption.com/">viagra levitra</a> 363714 <a href="http://www.mycarinsuranceprovider.com/cheap-car-insurance-chicago.html">IL cheap car insurance</a> 138555 <a href="http://www.topcarprotection.com/des-moines-car-insurance-quotes.html">cheap car insurance Iowa</a> >:DD <a href="http://www.mycarinsuranceprovider.com/cheap-car-insurance-new-york-city.html">classic car insurance taylor New York</a> 406 <a href="http://www.cheapinsurersinyourstate.com/">cheap car insurance</a> shzztm <a href="http://www.mycarinsuranceprovider.com/">online auto insurance</a> =[ <a href="http://www.insurquotesforfree.net/">quotes on car insurance</a> zjus~
~

//

#comment_kcaptcha

**CCgqJVOyjuRDpQrGl
>[[Margie]] (2013-07-26 (金) 17:32:25)~
~
<a href="http://www.onlinecollegeoffers.net/">online colleges</a> hikna <a href="http://bestcollegeonline.net/">courses online gis</a> xvtyrm <a href="http://edtabletsonline.net/">viagra pharmglobal</a> yeyiai <a href="http://getcheapinsurancehere.com/">website to find cheap car insurance</a> :-(( <a href="http://www.topcarprotection.com/milwaukee-car-insurance-quotes.html">WI auto insurance commercial</a> %] <a href="http://www.bestautoinsurancepolicies.net/">free car insurance</a> ndsbw~
~

//

#comment_kcaptcha

**fake oakleys
>[[Fashionsedsses]] (2013-07-26 (金) 16:52:38)~
~
We have been educated to believe that you <a href="http://www.rickgplus.com"><STRONG>wholesale mac cosmetics</STRONG></a> have either dry, oily, normal or a combination skin type. Nothing could be further from the truth. Many people have three to four types of skin on their face, which is why one person's skin is so vastly <a href="http://www.rickgplus.com"><STRONG>mac cosmetics wholesale</STRONG></a> different from anyone else's. So depending on your skin type you should look for a customized treatment plan. Someone with dry skin can go for a facial every <a href="http://www.rickgplus.com"><STRONG>mac cosmetics</STRONG></a> 10-12 days, People with oily and combination skin can go for a therapy every 12-15 <a href="http://www.rickgplus.com"><STRONG>cheap mac makeup</STRONG></a> days. Age is the most important factor in <a href="http://www.rickgplus.com"><STRONG>mac makeup wholesale</STRONG></a> determining the frequency of massages. One should start regarding skin as mature post 30. Eventually a massage is a healthy exchange of positive energy.~
~

//

#comment_kcaptcha

**nkqfNNMJebNNfsASinq
>[[Marge]] (2013-07-24 (水) 00:17:56)~
~
<a href="http://dallasinsuranceonline.com/">car insurance online quick quote</a> =-((( <a href="http://www.mycarinsuranceprovider.com/cheap-car-insurance-kansas-city.html">best auto insurance rates for the new year Missouri</a> bglt <a href="http://www.floridainsurquotes.com">auto insurance market</a> 51016 <a href="http://www.floridacarcoverage.com">auto insurance quotes nc Florida</a> rdabgj <a href="http://www.qualityskincare.net/">accutane arbitration</a> 80316~
~

//

#comment_kcaptcha

**tuPkxfmVxVyKl
>[[Kapri]] (2013-07-23 (火) 04:28:58)~
~
<a href="http://chicagoinsuranceonline.com/">Chicago free car insurance</a> :) <a href="http://www.autoinsurpolicy.com/">auto insurance quotes</a> 191745 <a href="http://www.comparequotesonline.net/">car insurance quotes</a> pqk <a href="http://www.buyautocoveronline.com/">cheap car insurance disc discout</a> ene <a href="http://insuredcar.net/">auto insurance non owner</a> 26760 <a href="http://autoinsuranceguidance.net/">auto insurance quotes</a> nhio~
~

//

#comment_kcaptcha

**eOyVoJgXDB
>[[Lidia]] (2013-07-19 (金) 10:23:02)~
~
<a href="http://sandiegoinsuranceonline.net/">citizen car insurance</a> ytcyql <a href="http://edtabletsonline.net/">viagra on the web</a> vghac <a href="http://dallasinsuranceonline.com/">Dallas top affordable car insurance</a> =-[ <a href="http://edmedicationguide.net/">viagra no prescription</a> 825 <a href="http://www.leadingautoinsurers.net/auto-insurance-quotes-utah.html">get car insurance</a> 305 <a href="http://choosecarinsurance.com/">cheap car insurance</a> iqtkyp <a href="http://www.illinoiscarinsur.com">illinois car insurance</a> %-D~
~

//

#comment_kcaptcha

**TKoOlExhqVOCsICbc
>[[Jera]] (2013-07-15 (月) 18:44:28)~
~
<a href="http://sandiegoinsuranceonline.net/">cheap car insurance las vegas</a> eqqzk <a href="http://nycarinsuranceonline.com/">cheap auto insurance online quotes north carolina</a> >:-P <a href="http://www.qualityskincare.net/">result of accutane treatment</a> crn <a href="http://www.insurancequoteslist.net/">auto insurance quotes for</a> rqgov <a href="http://www.cheappillsfored.com/">trusted site for online cialis</a> 83148~
~

//

#comment_kcaptcha

**BPZDgWuOXCpHOnPc
>[[Kaydi]] (2013-07-11 (木) 06:17:16)~
~
<a href="http://www.mycheapestinsurer.com/">cheap car insurance quotes</a> lux <a href="http://www.drugsforedonline.com/">cialis vs viagra</a> tgsy <a href="http://www.insureyourselfcheap.com/">cheap auto insurance</a> wkvd <a href="http://www.geterection.net/">viagra</a> smli <a href="http://www.cheappillsfored.com/">viagra cialis</a> 117501~
~

//

#comment_kcaptcha

**zuVaBLKqDuW
>[[Marsue]] (2013-07-11 (木) 01:12:18)~
~
<a href="http://www.mrfoleysleeds.com/">no generic viagra online without prescription</a> 6120 <a href="http://www.snoco150.net/">buying viagra online</a> 867 <a href="http://www.thebestautoinsurancequotes.net/">ap car insurance rates</a> 512920 <a href="http://www.comparequotesonline.net/">cheapest automobile insurance</a> mlhk <a href="http://getmedonline.net/">viagra on special</a> 1348~
~

//

#comment_kcaptcha

**JSysFXBTeIAuit
>[[Jera]] (2013-07-05 (金) 00:47:42)~
~
<a href="http://www.mycheapestinsurer.com/">good but cheap auto insurance</a> 8-PP <a href="http://www.carinsurancechoice.net/">gap insurance medical</a> gfjc <a href="http://www.autoinsurpolicy.com/">auto insurance quotes</a> 37842 <a href="http://www.bestqualityedtreatment.com/">cialis</a> 8[ <a href="http://www.geterection.net/">were to buy cialis</a> :))) <a href="http://www.insurancequoteslist.net/">insurance quotes auto</a> 9611~
~

//

#comment_kcaptcha

**KJwIMJJxFMtzVX
>[[Crissy]] (2013-07-01 (月) 13:22:51)~
~
<a href="http://www.ed-therapy.net/">cialis kaufen</a> qoqd <a href="http://www.autoinsurpolicy.com/">car insurance property</a> %DDD <a href="http://www.getmedicationonline.com/">viagra no prescription</a> axkl <a href="http://www.carinsuranceissue.com/">car insurance rates in ny</a> 629 <a href="http://www.chyronchat.com/">where to purchase Viagra</a> 11472 <a href="http://www.erectionperformance.net/">cialis tablets wholesale</a> gdrer~
~

//

#comment_kcaptcha

**llRwURvjfNA
>[[Ziarre]] (2013-06-24 (月) 08:00:11)~
~
<a href="http://www.freequotesuggestion.com/">free online car insurance quote</a> 9320 <a href="http://www.vadisrad.com/">online masters degree</a> 982691 <a href="http://getmedonline.net/">viagra online</a> %-]]] <a href="http://www.buyedtabletsonline.com/">mail order viagra</a> 53234 <a href="http://www.topratesforcarinsurance.com/">car insurance rate</a> bufo <a href="http://www.insureyourselfcheap.com/">home insurance</a> jbd <a href="http://www.improveyourerection.com/">sildenafil</a> 5696~
~

//

#comment_kcaptcha

**RkDSvywyhDU
>[[Fanni]] (2013-06-19 (水) 20:56:38)~
~
<a href="http://www.searchinsurancedeals.com/">low car insurance</a> 8-[[ <a href="http://www.locateinsurdeals.com/">free car insurance quotes</a> jtjnz <a href="http://www.amarzauto.com/">insurance auto</a> 61818 <a href="http://www.compareinsuroffersonline.com/">cheap auto insurance</a> mvzrbm <a href="http://www.edmedspartners.com/">generic cialis online</a> ttdft~
~

//

#comment_kcaptcha

**plSSFzkjSmqq
>[[Brandi]] (2013-06-14 (金) 08:56:18)~
~
<a href="http://www.getacnetreatment.net/">accutane purchase</a> hdt <a href="http://edtabletsonline.net/">buy viagra</a> xwcv <a href="http://www.treatingedonline.net/">cheap cialis</a> >:( <a href="http://www.sigmachiderbydays.org/">quotes cheapest insurance</a> =OOO <a href="http://www.u3ayarraranges.com/">auto insurance quotes</a> >:-]] <a href="http://www.forgetyoured.net/">buy levitra</a> %-]] <a href="http://www.aboutomaha8.com/">online omaha</a> edobhx~
~

//

#comment_kcaptcha

**DRnefPjAlc
>[[Kailyn]] (2013-06-09 (日) 07:26:58)~
~
<a href="http://www.GetCollegeDegreesOnline.com/">colleges online</a> cpf <a href="http://www.getacnetreatment.net/">accutane online pharmacy</a> uju <a href="http://autoinsurancechoice.net/">cheap auto insureance</a> %-] <a href="http://edpricesonline.com/">viagra alternatives</a> 498742 <a href="http://www.usaglobalquotes.com/">auto insurance quotes</a> bxrg <a href="http://insuredcar.net/">car insurance quotes</a> gqtgki~
~

//

#comment_kcaptcha

**tScUBjFyMrrZY
>[[Adelphia]] (2013-06-05 (水) 19:28:16)~
~
<a href="http://www.comfortedmeds.com/">cheap prices on cialis</a> 554 <a href="http://www.compareedmedsprices.com/">genericviagra</a> >:PP <a href="http://www.GetCollegeDegreesOnline.com/">online college courses</a> %[[ <a href="http://www.locateinsurdeals.com/">auto insurance quotes</a> dczbt <a href="http://www.edremedies.net/">cialis online</a> =)) <a href="http://www.edmedspartners.com/">buy cialis online</a> 1062 <a href="http://www.therapyfored.com/">viagra online</a> wqigat~
~

//

#comment_kcaptcha

**ruZyQRdoFKbBu
>[[Destiny]] (2013-06-03 (月) 01:02:09)~
~
<a href="http://www.accesstomedssavings.com/">where to buy prednisone</a> :-] <a href="http://www.usaglobalquotes.com/auto-insurance-quotes-georgia.html">auto insurance quotes Georgia</a> =-OOO <a href="http://www.comparecarquotesonline.com/">car insurance quotes</a> 620 <a href="http://edsupertabs.com/">cialis</a> kwic <a href="http://www.edtreatmentforyou.com/">viagra without a prescription</a> 073781 <a href="http://www.topratesforcarinsurance.com/">car insurance rate</a> 8-(~
~

//

#comment_kcaptcha

**elhmLqojueryvzvBDGy
>[[Celina]] (2013-06-03 (月) 01:01:37)~
~
<a href="http://edpricesonline.com/">buy viagra</a> iojgqb <a href="http://www.usaglobalquotes.com/auto-insurance-quotes-oregon.html">Portland auto insurance quotes</a> 282567 <a href="http://www.getyourerectionsback.com/">generic cialis</a> xpw <a href="http://www.onlinecollegeseasily.com/">courses online</a> nfvzb <a href="http://www.buyedtabletsonline.com/">viagra on line</a> 673 <a href="http://www.therapyfored.com/">viagra online</a> %[[[ <a href="http://www.yourcarinsurancequotes.net/">online auto insurance quotes</a> 8]]]~
~

//

#comment_kcaptcha

**RZptUCDVKkZWaCq
>[[Dollie]] (2013-05-29 (水) 02:40:15)~
~
<a href="http://www.comfortedmeds.com/">buy cialis online</a> 00187 <a href="http://www.autoprotectionoptions.com/">auto insurance quotes</a> 8PP <a href="http://www.edremedies.net/">cheapest cialis</a> %]]] <a href="http://www.edmedsshopping.com/">viagra without a prescription</a> arwpgf <a href="http://www.shopforedtabs.com/">viagra</a> rdznkj <a href="http://www.topinsurdealsonline.com/">car insurance quotes</a> >:-] <a href="http://www.topallergytreatment.com/">order prednisone</a> oqzdwa~
~

//

#comment_kcaptcha

**HNFwfvoTXLY
>[[Victory]] (2013-05-18 (土) 00:18:47)~
~
<a href="http://www.accesstomedssavings.com/">buy prednisone on-line</a> 8PP <a href="http://www.searchinsurancedeals.com/">auto insurance rates</a> %OO <a href="http://www.searchedmedsdeals.com/">prescription order sildenafil online</a> 915 <a href="http://www.pricesforedmeds.com/">levitra viagra</a> 4498 <a href="http://www.onlinecollegeseasily.com/">online colleges</a> 64368 <a href="http://getinsurlist.com/">carinsurance</a> monnzm <a href="http://www.mdicamentsenligne.fr/">cialis</a> 8((~
~

//

#comment_kcaptcha

**http://snapbacksunny.wordpress.com/
>[[cheap snapbacks online]] (2013-05-16 (木) 19:33:36)~
~
I have visited to this site multiple times and everytime I find beneficial jobs for me so I would suggest please come to this site and take the chance from here~
~

//

#comment_kcaptcha

**UggwxVNNwiJzb
>[[Lily]] (2013-05-15 (水) 01:52:44)~
~
<a href="http://autoinsurshopping.com/">cheap auto insurance</a> %D <a href="http://edsupertabs.com/">cialis</a> piofj <a href="http://www.onlinecollegeseasily.com/">online schools</a> 8( <a href="http://www.carinsurproviders.com/">cheap car insurance</a> 99462 <a href="http://www.listofcarquotes.com/">auto insurance online</a> 096562 <a href="http://www.topinsurdealsonline.com/">car insureance</a> %(((~
~

//

#comment_kcaptcha

**JEKMzXFbPmWQkzyjac
>[[Allie]] (2013-05-11 (土) 02:51:14)~
~
<a href="http://www.autocoverageonline.net/">auto insurance</a> soj <a href="http://www.comparecarquotesonline.com/">free car insurance quotes</a> xkjr <a href="http://www.edmedsonline4you.com/">cialis</a> vhnczc <a href="http://www.comparebestquotes.net/">online auto insurance</a> >:-] <a href="http://getinsurlist.com/">car insureance</a> 4154~
~

//

#comment_kcaptcha

**PTTApxTJjN
>[[Kalie]] (2013-05-07 (火) 22:49:12)~
~
<a href="http://www.autocoverageonline.net/">auto insurance</a> 34944 <a href="http://www.medstabs4you.com/">ordering cialis online</a> nngw <a href="http://www.medspricechart.com/">buy viagra</a> 974 <a href="http://www.locatemedsonline.com/">viagra without a prescription</a> =-OO <a href="http://www.cheapinsurdealsfast.com/">cheap auto insurance</a> 8) <a href="http://getinsurlist.com/">cheap car insurance</a> kqiysj <a href="http://www.topinsurdealsonline.com/">car insurance quotes</a> :-O~
~

//

#comment_kcaptcha

**ZPQQOmLqIKaPBNrjV
>[[Kaylynn]] (2013-05-04 (土) 10:15:54)~
~
<a href="http://www.tratamientodelaed.es/">Cialis barata online</a> >:-O <a href="http://www.carinsurcompanies.com/">car insurance</a> 8577 <a href="http://www.cheapinsurdealsfast.com/">car insurance</a> tqd <a href="http://www.compareinsuroffersonline.com/">auto insurance</a> nqleq <a href="http://www.insurcomparisonservice.com/">car insurance quotes</a> tdy <a href="http://www.edmedsonline4you.com/">ordering cialis online</a> 648 <a href="http://getinsurlist.com/">cheap car insurance</a> >:[[[~
~

//

#comment_kcaptcha

**DCcnAZecaMJCcAp
>[[Tailynn]] (2013-05-02 (木) 21:31:36)~
~
<a href="http://www.tratamientodelaed.es/">cialis</a> 8DD <a href="http://www.medstabs4you.com/">price of cialis</a> xtcz <a href="http://www.cheapinsurdealsfast.com/">auto insurance quotes</a> %-DDD <a href="http://www.edmedsonline4you.com/">cialis for sale</a> %-))) <a href="http://www.carinsurcompanies.net/">car insurance in florida</a> 2010 <a href="http://www.findbestinsurquotes.com/">car insurance rates</a> >:-PP <a href="http://www.mdicamentsenligne.fr/">Cialis tadalafil</a> 388879~
~

//

#comment_kcaptcha

**QjxUyGefLaZZEdOfLs
>[[Jayan]] (2013-04-23 (火) 05:51:48)~
~
<a href="http://www.findcheapinsurproviders.com/">new york car insurance</a> 302 <a href="http://www.comparecarquotesonline.com/">car insurance quotes</a> 8927 <a href="http://www.insurcomparisonservice.com/">eastwood auto insurance</a> snbbxf <a href="http://www.carinsurcompanies.net/">car insurance in florida</a> wfjs <a href="http://getinsurlist.com/">car insurance in florida</a> xglazl~
~

//

#comment_kcaptcha

**cZuGMUwSya
>[[Queenie]] (2013-04-21 (日) 10:35:17)~
~
<a href="http://www.autocoverageonline.net/">auto insurance</a> ikjhwx <a href="http://www.carinsurcompanies.com/">car insurance</a> kunf <a href="http://www.comparebestquotes.net/">car insurance quotes</a> 720 <a href="http://www.carinsurproviders.com/">cheap car insurance</a> khvc <a href="http://www.topinsurdealsonline.com/">eastwood auto insurance</a> 830 <a href="http://www.mdicamentsenligne.fr/">cialis</a> 7502~
~

//

#comment_kcaptcha

**cDrNKWrtrKTBkOfVA
>[[Maryellen]] (2013-04-18 (木) 22:35:40)~
~
<a href="http://www.stuartmckeown.com/">best car insurance rates</a> 3353 <a href="http://www.findcheapinsurproviders.com/">car insureance</a> 11197 <a href="http://www.simondonconference.org/">online car insurance</a> bptdk <a href="http://www.carinsurcompanies.net/">car insurance in florida</a> >:OOO <a href="http://www.carinsurproviders.com/">free car insurance quotes</a> yrnlg~
~

//

#comment_kcaptcha

**qzXSsqHcsKZ
>[[Charl]] (2013-04-16 (火) 13:29:24)~
~
<a href="http://www.testimoniocubano.com/">affordable auto insurance</a> 8))) <a href="http://www.pricesforedmeds.com/">apcalis levitra viagra</a> xiiw <a href="http://www.locatemedsonline.com/">viagra</a> 92985 <a href="http://www.comparecarquotesonline.com/">online auto insurance</a> >:[[ <a href="http://www.onlinecollegeseasily.com/">online college</a> euew <a href="http://www.carinsurquote.com/">buy auto insurance online</a> cyazi~
~

//

#comment_kcaptcha

**gkRoBjfPkMdnJrFCg
>[[Foge]] (2013-03-25 (月) 02:07:23)~
~
<a href="http://www.autocoverageonline.net/">car insurance in florida</a> rowu <a href="http://www.mymedicationguide.com/">accutane purchase</a> qthem <a href="http://www.cheapestcarinsuronline.com/">car insurence</a> aszw <a href="http://www.findbestonlinecourses.com/">online courses</a> hxxdr~
~

//

#comment_kcaptcha

**ibOjRQnyyQLWktq
>[[Genevieve]] (2013-03-21 (木) 11:18:00)~
~
<a href="http://www.carinsurquote.net/">florida auto insurance</a> 0920 <a href="http://www.getcarinsurquote.com/">car insurance in florida</a> 544589 <a href="http://www.compareautoinsur.com/">new york car insurance</a> 067477~
~

//

#comment_kcaptcha

**LssYbWYLbBwfmC
>[[Shorty]] (2013-03-14 (木) 18:54:00)~
~
<a href="http://www.edpillsshop.net/">viagra and levitra</a> aud <a href="http://www.carinsurcompanies.com/">car insurance</a> >:-((( <a href="http://www.insurquotes.net/">buy insurance online</a> 8PPP <a href="http://www.rutgersgsnb.org/">accutane online</a> 754~
~

//

#comment_kcaptcha

**AEjXtwBfhEviP
>[[Dany]] (2013-03-13 (水) 09:38:01)~
~
<a href="http://www.discoveronlinecolleges.net/">online colleges</a> okgrv <a href="http://www.msgvarsitysummerstars.com/">buy car insurance online</a> 218344 <a href="http://www.mymedicationsonline.com/">cialis online</a> 8)) <a href="http://www.treatallergicdisorder.com/">prednisone</a> vcnhl~
~

//

#comment_kcaptcha

**rYSuvVUBGtpR
>[[Theresa]] (2013-03-05 (火) 07:47:12)~
~
<a href="http://www.lovedecoo.com/">buy viagra</a> >:) <a href="http://www.stpredevelopment.com/">prednisone</a> 2737 <a href="http://www.findbestonlinecourses.com/">online degree</a> irnnvj <a href="http://www.rutgersgsnb.org/">accutane</a> vmjmo~
~

//

#comment_kcaptcha

**nLdtlROvsHp
>[[Carlinda]] (2013-03-03 (日) 20:26:41)~
~
<a href="http://www.orderedpillsonline.com/">viagra online</a> khib <a href="http://www.bestcarinsurrates.com/">car insurence</a> 8-((( <a href="http://www.clemsondsp.org/">buy car insurance online</a> 8DD <a href="http://www.liensmedias.com/">a auto insurance</a> ejlrz~
~

//

#comment_kcaptcha

**oKEiWQoVOJOByNcC
>[[Blondy]] (2013-02-16 (土) 01:41:37)~
~
<a href="http://www.edgenericmedication.com/">sildenafil</a> nqitx <a href="http://www.treatmentforinfections.com/">cipro online prescription</a> fdm <a href="http://www.greatcarinsurquotes.com/">auto insurance online</a> 08794~
~

//

#comment_kcaptcha

**vXEPbFjJdN
>[[Melissa]] (2013-02-13 (水) 13:44:50)~
~
<a href="http://www.buyedmedsonline.com/">buy cialis online</a> =)) <a href="http://www.onlinecheapautoinsur.com/">cheap auto insurance</a> >:-O <a href="http://www.cheapestcarproviders.com/">florida auto insurance</a> %-OOO~
~

//

#comment_kcaptcha

**znOSCxKtgUoKHYBqH
>[[Jacklynn]] (2013-01-23 (水) 01:54:52)~
~
<a href="http://cheapautoinsurer.net/">cheap auto insurance</a> =]]] <a href="http://www.lifeinsuranceshopping.net/">life insurance quotes</a> :] <a href="http://edmedsinfo.com/">viagra</a> :-OO~
~

//

#comment_kcaptcha

**TkqsKrgbWCWF
>[[Betti]] (2013-01-16 (水) 01:34:24)~
~
<a href="http://www.autoinsurers4u.com/">car insurance</a> 3267 <a href="http://www.mylifeinsuranceguide.net/">life insurance</a> 8]]] <a href="http://www.lifeinsuranceshopping.net/">universal life insurance</a> hen <a href="http://www.bestautoinsurancepolicies.net/">affordable auto insurance</a> %-D~
~

//

#comment_kcaptcha

**PUCRflnGdwZzNkb
>[[Maisyn]] (2013-01-06 (日) 13:00:38)~
~
<a href="http://www.onlinecheapautoinsurance.net/">new york car insurance</a> 67840 <a href="http://www.mylifeinsuranceguide.net/">life insurance quote</a> rbm <a href="http://www.aboutcarinsurancerates.com/">cheap auto insurance</a> gkpyc~
~

//

#comment_kcaptcha

**qyutjeuflEx
>[[Jenny]] (2012-11-14 (水) 20:16:27)~
~
<a href="http://www.antidepressioncare.com/">prozac</a> fuxg <a href="http://pacificcrestforaging.com/">cialis</a> 8]]~
~

//

#comment_kcaptcha

**SNOwswNbnWZBjL
>[[Bubi]] (2012-11-14 (水) 03:52:41)~
~
<a href="http://www.bestcarinsurquotes.com/">car insurance quotes</a> 8O <a href="http://lf1medsoc.com/">auto insurance rates</a> kdnq~
~

//

#comment_kcaptcha

**xADTIVryXhZlCGx
>[[Lena]] (2012-11-11 (日) 22:16:57)~
~
<a href="http://randompattern.net/">cheap california auto insurance</a> %DDD <a href="http://howsmarriedlife.com/">auto insurance quote</a> 6491~
~

//

#comment_kcaptcha

**doCwhUurgnkOAwpev
>[[Lesa]] (2012-11-09 (金) 23:20:40)~
~
<a href="http://randompattern.net/">car insurance rates</a> ray <a href="http://aixnmr.com/">auto insurance quotes</a> %-]~
~

//

#comment_kcaptcha

**EYEQiOwjbYrZbzOWNx
>[[Romby]] (2012-11-08 (木) 09:32:22)~
~
<a href="http://randompattern.net/">free car insurance quotes</a> 200 <a href="http://lf1medsoc.com/">cheapest car insurance</a> 231882~
~

//

#comment_kcaptcha

**HEhbrqQWXIjio
>[[Jennah]] (2012-11-04 (日) 20:33:41)~
~
<a href="http://www.getacheapcoverage.com/">buy auto insurance online</a> 536156 <a href="http://www.menmedsonline.com/">generic priligy</a> 951~
~

//

#comment_kcaptcha

**tXZDhxUPQjNE
>[[Honney]] (2012-11-03 (土) 00:38:02)~
~
<a href="http://www.findherpesmeds.com/">valtrex buy 4sex</a> 8687 <a href="http://www.searchedtabs.com/">levitra</a> gcq~
~

//

#comment_kcaptcha

**nMpuJNZOpFhIh
>[[Boston]] (2012-11-01 (木) 00:14:21)~
~
<a href="http://www.menmedsonline.com/">priligy</a> >:OOO <a href="http://www.searchedtabs.com/">levitra addicting online games</a> 3436~
~

//

#comment_kcaptcha

**QkVYVBxWtUJUlJT
>[[Geraldine]] (2012-10-27 (土) 23:14:11)~
~
<a href="http://www.insurquotestoday.com/">insurance quotes</a> 58508 <a href="http://www.creditcardsproviders.net/">credit cards</a> 7072~
~

//

#comment_kcaptcha

**PebRuUwNtTcpIMs
>[[Jaylene]] (2012-10-26 (金) 01:55:51)~
~
<a href="http://www.getyourautoinsur.com/">online car insurance</a> :O <a href="http://www.carinsurshopping.com/">car insurance</a> vkq~
~

//

#comment_kcaptcha

**vLMqfluetDTVJ
>[[iwvfwiahw]] (2012-10-17 (水) 16:01:31)~
~
iO0TKf  <a href="http://nshhdqqovuzw.com/">nshhdqqovuzw</a>~
~

//

#comment_kcaptcha

**UGaCXwoUitdcNbrgIem
>[[Suhana]] (2012-10-17 (水) 04:02:12)~
~
Okay I'm convinced. Let's put it to actoin.~
~

//

#comment_kcaptcha

**円エフェクトの半径と不透明度をランダムに
> (2011-03-12 (土) 16:04:56)~
~
ディスプレイスメントマップを使って波紋を作っているんですが、マップで波紋のように変形させるため円エフェクトを使っています。~
半径を0から300、それに合わせて不透明度を100から0を2秒で行うようにに設定しています。~
それを何個か並べているのですが動きがみな同じなため、機械的な波紋に見えてしまいます。エクスプレッションで半径と不透明度をランダムに設定することはできないのでしょうか?~
~
プロジェクトファイルを上げました。~
http://u9.getuploader.com/nicoAE/download/522/%E3%83%97%E3%83%AD%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E7%AD%89.zip~
よろしくお願いします。~
~

//

#comment_kcaptcha

**プロパティスクリプト投稿テスト
>[[うp主]] (2011-02-21 (月) 18:40:24)~
~
プロパティスクリプトのサンプルのテスト。~
開始や終了を1フレームごとに1文字分変化させるのに便利な感じのスクリプト。~
~
#code(propertyscript){{
return 100.0 / strLen(replace(getProperty("ソーステキスト"), "\r\n", "")) * timeToFrames(time);
}}
~

//

#comment_kcaptcha

**レンダラの選択サンプル [#s0a7822b]
>[[うp主]] (2011-02-09 (水) 14:36:03)~
~
オートメーションでのレンダラの選択について質問があったので、適当ですがやってみました。~
~
#code(csharp,rendererSelectSample){{
[MainCode]
using (RendererSelectWindow window = new RendererSelectWindow(manager))
{
    if (window.ShowDialog() == DialogResult.OK)
    {
        manager.NewComposition("", new CompositionSetting(window.SelectedRendererName, window.SelectedRenderer, new Size(640, 480), 30.0, 10.0, 180.0, -90.0, 16));
    }
}
[MethodCode]
class RendererSelectWindow : Form
{
    public RendererSelectWindow(IAutomationManager manager)
    {
        InitializeComponent();
        //プラグイン名取得
        renderer = new Dictionary<string, string>();
        foreach (KeyValuePair<string, Type> plugin in manager.GetAllRendererPlugin())
        {
            using (RendererBase r = (RendererBase)Activator.CreateInstance(plugin.Value))
            {
                renderer.Add(r.PluginName, plugin.Key);
                rendererComboBox.Items.Add(r.PluginName);
            }
        }

        rendererComboBox.SelectedIndex = 0;
    }

    Dictionary<string, string> renderer = null;
    ComboBox rendererComboBox = null;
    public string SelectedRenderer
    {
        get
        {
            return renderer[(string)rendererComboBox.SelectedItem];
        }
    }
    public string SelectedRendererName
    {
        get
        {
            return (string)rendererComboBox.SelectedItem;
        }
    }

    void InitializeComponent()
    {
        Label label = new Label();
        label.Text = "レンダラ:";
        label.Location = new Point(12, 15);
        label.AutoSize = true;

        Button okButton = new Button();
        okButton.Location = new Point(12, 42);
        okButton.Text = "OK";
        okButton.DialogResult = DialogResult.OK;

        Button cancelButton = new Button();
        cancelButton.Location = new Point(91, 42);
        cancelButton.Text = "キャンセル";
        cancelButton.DialogResult = DialogResult.Cancel;

        rendererComboBox = new ComboBox();
        rendererComboBox.Location = new Point(58, 12);
        rendererComboBox.Width = 150;
        rendererComboBox.DropDownStyle = ComboBoxStyle.DropDownList;

        this.ClientSize = new Size(220, 75);
        this.MaximizeBox = false;
        this.MinimizeBox = false;
        this.ShowIcon = false;
        this.ShowInTaskbar = false;
        this.FormBorderStyle = FormBorderStyle.FixedDialog;
        this.StartPosition = FormStartPosition.CenterParent;
        this.Text = "レンダラの選択";
        this.Controls.Add(label);
        this.Controls.Add(rendererComboBox);
        this.Controls.Add(okButton);
        this.Controls.Add(cancelButton);
    }
}
[UsingNamespace]

[Reference]
}}
~

//

#comment_kcaptcha

**投稿方法について [#e20ffa78]
>[[金の髭]] (2010-12-26 (日) 21:05:58)~
~
Wikiそのものの質問になってしまって恐縮なのですが・・・。~
 質問1.試しに以下の例のように記述して投稿してみたところ、他の記事も含めて全体が折りたたまれてしまいました。~
      投稿時はcode(csharp)だけで投稿し、regionは投稿後ページ編集で付け足す必要があるのでしょうか?~
      (下の例では行頭の#は省略しています)~
 質問2.regionが使われるたびに、その後の記事のインデントがずれていっているようですがこれは仕様になりますでしょうか。~
~
↓投稿例~
~
region(←コードはこちら)~
~
code(csharp){{~
~
int a=0;~
~
}}~
~
endregion~
~

//
- 確認しました。どうやら、&nop(#endregion);の後に&nop(~);が入ることによって、影響範囲がおかしくなってしまうようです。また、インデントについては&nop(#region);の次の行に&nop(~);を入れると解消されるようです。いずれも修正できる場合は修正しておきます。 -- [[うp主]] &new{2010-12-29 (水) 19:15:22};
- と思ったら、どうやら&nop(~);を挟んでもインデントは解除されないようです orz &nop(#region)自体が結構裏技的なことをやっているそうなので、この問題の解決は難しいかもしれません。 -- [[うp主]] &new{2010-12-29 (水) 20:12:07};
- codeプラグインの方に手を加えてregionプラグインを使用せずに折りたためるようにしてみました。これで多分インデントの問題も解決できるかと思うので、そちらを試してみてください。 -- [[うp主]] &new{2010-12-30 (木) 01:12:24};
- 上の例でうまくいくことを確認しました。対応ありがとうございます。色々すみません。 -- [[金の髭]] &new{2010-12-31 (金) 23:36:29};

#comment_kcaptcha

**ウィグル適用ウインドウ [#gbad8610]
>[[うp主]] (2010-12-12 (日) 13:17:57)~
~
指定したプロパティにウィグルを適用し、キーフレームを設定します。~
~
使い方:~
各コンボボックスから適用したいものを選択します。~
間隔、複雑度、強さ、開始時間、終了時間を入力し、適用を押します。~
~
パラメータの説明:~
対象  : プロパティを所持するエフェクト、またはレイヤープロパティを指定します~
次元  : 値を適用する次元(軸)を選択します。~
間隔  : 1秒間にキーフレームをいくつ置くかを設定します。~
複雑度 : 振動の激しさを設定します。~
強さ  : 値の変化の度合いを設定します。~
開始時間: キーフレームの設置を開始する時間をレイヤーのローカル時間で設定します。~
終了時間: キーフレームの設置を終了する時間をレイヤーのローカル時間で設定します。~
適用  : 設定を元にキーフレームを設定します。~
閉じる : ウインドウを閉じます。~
コンポジション更新: コンポジションの情報を更新します。~
これ以外のコンボボックス: 見たままなので略。~
~
以下コード。長め注意~
~
#code(csharp, コード){{

[MainCode]

WiggleSettingWindow window = new WiggleSettingWindow(manager);
window.Show();

[MethodCode]

//ウィグル用メソッドのデリゲート
delegate PropertyBase WiggleMethod(PropertyBase property, float x, int oct, double amp, int dimension);

//各プロパティで対応する次元とウィグル用メソッドを格納するクラス
class PropertyData
{
    public PropertyData(string[] dim, WiggleMethod method, PropertyInterpolationType type)
    {
        Type = type;
        DimensionName = dim;
        WiggleMethod = method;
    }

    public PropertyInterpolationType Type = default(PropertyInterpolationType);
    public string[] DimensionName = null;
    public WiggleMethod WiggleMethod = null;
}

class WiggleSettingWindow : Form
{
    public WiggleSettingWindow(IAutomationManager manager)
    {
        //対応する型を設定する
        propertyData = new Dictionary<Type, PropertyData>();
        propertyData.Add(typeof(NumberProperty), new PropertyData(new string[] { "なし" }, WiggleNumberProperty, PropertyInterpolationType.Fixed | PropertyInterpolationType.Liner | PropertyInterpolationType.CatmullRom));
        propertyData.Add(typeof(RadianProperty), new PropertyData(new string[] { "なし" }, WiggleRadianProperty, PropertyInterpolationType.Fixed | PropertyInterpolationType.Liner | PropertyInterpolationType.CatmullRom));
        propertyData.Add(typeof(VertexProperty), new PropertyData(new string[] { "X", "Y", "Z", "各軸個別", "各軸同一" }, WiggleVertexProperty, PropertyInterpolationType.Fixed | PropertyInterpolationType.Liner | PropertyInterpolationType.CatmullRom));
        //対応する型を増やす場合はここ以下に記述する
        //書式:
        //propertyData.Add(typeof(対応する型), new PropertyData(new string[] { 対応する次元 }, ウィグル用メソッド, 対応する補間タイプ));
        //例:
        //propertyData.Add(typeof(ColorProperty), new PropertyData(new string[] { "R", "G", "B", "A", "RGB同一", "RGBA同一" }, WiggleColorProperty, PropertyInterpolationType.Fixed | PropertyInterpolationType.Liner | PropertyInterpolationType.CatmullRom));

        InitializeComponent();
        m = manager;
        //ランダムシードはここで変更する
        seed = this.GetHashCode();
        RefreshComposition();
    }

    //各種コントロール
    ComboBox compositionComboBox = null;
    ComboBox layerComboBox = null;
    ComboBox targetComboBox = null;
    ComboBox propertyComboBox = null;
    ComboBox dimensionComboBox = null;
    ComboBox interpolationComboBox = null;
    TextBox keyframeTextBox = null;
    TextBox octTextBox = null;
    TextBox ampTextBox = null;
    TextBox startTimeTextBox = null;
    TextBox endTimeTextBox = null;
    Button applyButton = null;
    //オートメーションマネージャ
    IAutomationManager m = null;
    //コンポジション
    IComposition[] composition = null;
    //レイヤー
    ILayer[] layer = null;
    //エフェクト
    IEffect[] effect = null;
    //プロパティの名前
    string[] propertyName = null;
    //プロパティの型
    Dictionary<string, Type> propertyType = null;
    //各プロパティの設定
    Dictionary<Type, PropertyData> propertyData = null;
    //複雑度
    int octave = 6;
    //ランダムシード
    int seed = 0;
    //コンボボックスの"なし"のインデックス用パディング
    const int itemPadding = 1;
    //上の定数のエフェクト用
    const int effectPadding = 2;

    //コンポジションの更新
    void RefreshComposition()
    {
        composition = m.GetComposition();
        layer = null;
        compositionComboBox.Items.Clear();
        compositionComboBox.Items.Add("なし");
        for (int i = 0; i < composition.Length; i++)
        {
            compositionComboBox.Items.Add(composition[i].Setting.Name);
        }
        compositionComboBox.SelectedIndex = 0;
    }

    //NumberProperty用ウィグルメソッド
    PropertyBase WiggleNumberProperty(PropertyBase property, float x, int oct, double amp, int dimension)
    {
        NumberProperty np = (NumberProperty)property;
        np.DoubleValue = ExpressionUtils.Wiggle(seed, x, oct, np.DoubleValue, amp);
        return property;
    }

    //RadianProperty用ウィグルメソッド
    PropertyBase WiggleRadianProperty(PropertyBase property, float x, int oct, double amp, int dimension)
    {
        RadianProperty rp = (RadianProperty)property;
        return new RadianProperty(rp.PropertyName, 0, ExpressionUtils.Wiggle(seed, x, oct, rp.ToAngle(), amp));
        return property;
    }

    //VertexProperty用ウィグルメソッド
    //次元についてはコンストラクタ、またはメソッド内で使用しているプロパティを参照のこと
    PropertyBase WiggleVertexProperty(PropertyBase property, float x, int oct, double amp, int dimension)
    {
        VertexProperty vp = (VertexProperty)property;
        switch(dimension)
        {
            case 0:
                {
                    vp.X = ExpressionUtils.Wiggle(seed, x, oct, vp.X, amp);
                    break;
                }
            case 1:
                {
                    vp.Y = ExpressionUtils.Wiggle(seed, x, oct, vp.Y, amp);
                    break;
                }
            case 2:
                {
                    vp.Z = ExpressionUtils.Wiggle(seed, x, oct, vp.Z, amp);
                    break;
                }
            case 3:
                {
                    vp.VertexValue = ExpressionUtils.Wiggle(seed, x, oct, vp.VertexValue, new Vertex(amp, amp, amp));
                    break;
                }
            case 4:
                {
                    double w = ExpressionUtils.Wiggle(seed, x, oct, 0.0, amp);
                    vp.X += w;
                    vp.Y += w;
                    vp.Z += w;
                    break;
                }
        }
        return property;
    }

    //対応する型のウィグル用メソッドを追加する。書式はWiggleMethodデリゲートに従う。
    //例:
    //PropertyBase WiggleColorProperty(PropertyBase property, float x, int oct, double amp, int dimension)
    //{
    //    ColorProperty cp = (ColorProperty)property;
    //    switch(dimension)
    //    {
    //        case 0:
    //            {
    //                cp.R = (byte)Math.Min(Math.Max(ExpressionUtils.Wiggle(seed, x, oct, cp.R, amp), 0.0), 255.0);
    //                break;
    //            }
    //        case 1:
    //            {
    //                cp.G = (byte)Math.Min(Math.Max(ExpressionUtils.Wiggle(seed, x, oct, cp.G, amp), 0.0), 255.0);
    //                break;
    //            }
    //        case 2:
    //            {
    //                cp.B = (byte)Math.Min(Math.Max(ExpressionUtils.Wiggle(seed, x, oct, cp.B, amp), 0.0), 255.0);
    //                break;
    //            }
    //        case 3:
    //            {
    //                cp.A = (byte)Math.Min(Math.Max(ExpressionUtils.Wiggle(seed, x, oct, cp.A, amp), 0.0), 255.0);
    //                break;
    //            }
    //        case 4:
    //            {
    //                double w = ExpressionUtils.Wiggle(seed, x, oct, 0.0, amp);
    //                cp.R = (byte)Math.Min(Math.Max(cp.R + w, 0.0), 255.0);
    //                cp.G = (byte)Math.Min(Math.Max(cp.G + w, 0.0), 255.0);
    //                cp.B = (byte)Math.Min(Math.Max(cp.B + w, 0.0), 255.0);
    //                break;
    //            }
    //        case 5:
    //            {
    //                double w = ExpressionUtils.Wiggle(seed, x, oct, 0.0, amp);
    //                cp.R = (byte)Math.Min(Math.Max(cp.R + w, 0.0), 255.0);
    //                cp.G = (byte)Math.Min(Math.Max(cp.G + w, 0.0), 255.0);
    //                cp.B = (byte)Math.Min(Math.Max(cp.B + w, 0.0), 255.0);
    //                cp.A = (byte)Math.Min(Math.Max(cp.A + w, 0.0), 255.0);
    //                break;
    //            }
    //    }
    //    
    //    return property;
    //}

    //キーフレームを設定する
    void SetWiggle(int keyframeRate, int oct, double amp, double startTime, double endTime, int dimension, PropertyInterpolationType type, WiggleMethod wiggle, ILayer targetLayer, IEffect targetEffect, Func<double, PropertyBase> propertyGetter)
    {
        double rate = 1.0 / (double)keyframeRate;
        int count = (int)((endTime - startTime) / rate);
        float addx = 360.0F / (float)count;
        if (count > 0)
        {
            //一度キーフレームを全て作成してから追加する
            KeyFrame[] keyFrame = new KeyFrame[count];
            for (int i = 0; i < count; i++)
            {
                double time = Math.Round(startTime + rate * i, ReferenceData.MinimumTimeDigit, MidpointRounding.ToEven);
                keyFrame[i] = new KeyFrame(time, wiggle(propertyGetter(time), addx * i, oct, amp, dimension), type);
            }
            //対象が入力・レイヤープロパティの場合はtargetEffectはnull
            if (targetEffect != null)
            {
                for (int i = 0; i < count; i++)
                {
                    m.AddKeyFrame(targetEffect, keyFrame[i]);
                }
            }
            else
            {
                for (int i = 0; i < count; i++)
                {
                    m.AddKeyFrame(targetLayer, keyFrame[i]);
                }
            }
        }
    }

    //コンポジション選択時のイベント
    void compositionComboBox_SelectedIndexChanged(object sender, EventArgs e)
    {
        layer = null;
        layerComboBox.Items.Clear();
        layerComboBox.Items.Add("なし");
        try
        {
            if (compositionComboBox.SelectedIndex > 0)
            {
                //レイヤーを取得
                layer = composition[compositionComboBox.SelectedIndex - itemPadding].GetLayer();
                for (int i = 0; i < layer.Length; i++)
                {
                    layerComboBox.Items.Add(layer[i].ItemName);
                }
            }
        }
        catch { }
        layerComboBox.SelectedIndex = 0;
    }

    //レイヤー選択時のイベント
    void layerComboBox_SelectedIndexChanged(object sender, EventArgs e)
    {
        effect = null;
        targetComboBox.Items.Clear();
        targetComboBox.Items.Add("なし");
        if (layer != null && layerComboBox.SelectedIndex > 0)
        {
            targetComboBox.Items.Add("レイヤー");
            //エフェクトを取得
            effect = layer[layerComboBox.SelectedIndex - itemPadding].GetEffect();
            for (int i = 0; i < effect.Length; i++)
            {
                targetComboBox.Items.Add(effect[i].ItemName);
            }
        }
        targetComboBox.SelectedIndex = 0;
    }

    //対象選択時のイベント
    void targetComboBox_SelectedIndexChanged(object sender, EventArgs e)
    {
        propertyName = null;
        propertyType = new Dictionary<string, Type>();
        propertyComboBox.Items.Clear();
        propertyComboBox.Items.Add("なし");
        if (targetComboBox.SelectedIndex > 0)
        {
            //"レイヤー"の場合は入力・レイヤープロパティを対象とする
            if (targetComboBox.SelectedIndex > 1)
            {
                //対象のエフェクト
                IEffect se = effect[targetComboBox.SelectedIndex - effectPadding];
                propertyName = m.GetPropertyNames(se);
                for (int i = 0; i < propertyName.Length; i++)
                {
                    PropertyBase p = m.GetProperty(se, propertyName[i], 0.0);
                    //ウィグルに対応するプロパティのみを表示
                    if (p != null && propertyData.ContainsKey(p.GetType()))
                    {
                        propertyType.Add(propertyName[i], p.GetType());
                    }
                }
            }
            else
            {
                //対象のレイヤー
                ILayer sl = layer[layerComboBox.SelectedIndex - itemPadding];
                propertyName = m.GetPropertyNames(sl);
                for (int i = 0; i < propertyName.Length; i++)
                {
                    PropertyBase p = m.GetProperty(sl, propertyName[i], 0.0);
                    //ウィグルに対応するプロパティのみを表示
                    if (p != null && propertyData.ContainsKey(p.GetType()))
                    {
                        propertyType.Add(propertyName[i], p.GetType());
                    }
                }
            }
            //対応するプロパティの名前をコンボボックスに追加
            propertyName = new string[propertyType.Count];
            propertyType.Keys.CopyTo(propertyName, 0);
            propertyComboBox.Items.AddRange(propertyName);
        }
        propertyComboBox.SelectedIndex = 0;
    }

    //プロパティ選択時のイベント
    void propertyComboBox_SelectedIndexChanged(object sender, EventArgs e)
    {
        dimensionComboBox.Items.Clear();
        interpolationComboBox.Items.Clear();
        //対応する次元と補間タイプを表示
        if (propertyComboBox.SelectedIndex > 0)
        {
            PropertyData sp = propertyData[propertyType[propertyName[propertyComboBox.SelectedIndex - 1]]];
            dimensionComboBox.Items.AddRange(sp.DimensionName);
            if ((sp.Type & PropertyInterpolationType.Fixed) != 0)
            {
                interpolationComboBox.Items.Add(PropertyInterpolationType.Fixed);
            }
            if ((sp.Type & PropertyInterpolationType.Liner) != 0)
            {
                interpolationComboBox.Items.Add(PropertyInterpolationType.Liner);
            }
            if ((sp.Type & PropertyInterpolationType.CatmullRom) != 0)
            {
                interpolationComboBox.Items.Add(PropertyInterpolationType.CatmullRom);
            }
        }
        else
        {
            dimensionComboBox.Items.Add("なし");
            interpolationComboBox.Items.Add("なし");
        }
        dimensionComboBox.SelectedIndex = 0;
        interpolationComboBox.SelectedIndex = 0;
    }

    //適用ボタン押下時のイベント
    void applyButton_Click(object sentder, EventArgs e)
    {
        try
        {
            if (propertyComboBox.SelectedIndex > 0)
            {
                int keyframeRate = 0;
                int oct = 0;
                double amp = 0.0;
                double startTime = 0.0;
                double endTime = 0.0;
                ILayer tl = null;
                IEffect te = null;
                Func<double, PropertyBase> propertyGetter = null;
                if (!int.TryParse(keyframeTextBox.Text, out keyframeRate))
                {
                    MessageBox.Show("間隔の値が異常です", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (!int.TryParse(octTextBox.Text, out oct))
                {
                    MessageBox.Show("複雑度の値が異常です", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (!double.TryParse(ampTextBox.Text, out amp))
                {
                    MessageBox.Show("強さの値が異常です", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (!double.TryParse(startTimeTextBox.Text, out startTime))
                {
                    MessageBox.Show("開始時間の値が異常です", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (!double.TryParse(endTimeTextBox.Text, out endTime))
                {
                    MessageBox.Show("終了時間の値が異常です", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (keyframeRate < 1)
                {
                    MessageBox.Show("間隔の値を0以下にすることは出来ません", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (oct < 1 || oct > 100)
                {
                    MessageBox.Show("複雑度の値を0以下、または100以上にすることは出来ません", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (amp == 0.0)
                {
                    MessageBox.Show("強さの値を0にすることは出来ません", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (startTime > endTime)
                {
                    MessageBox.Show("開始時間を終了時間より大きくすることは出来ません。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else if (startTime == endTime)
                {
                    MessageBox.Show("開始時間と終了時間を同じにすることは出来ません。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                tl = layer[layerComboBox.SelectedIndex - 1];
                //対象が"レイヤー"の場合は(ry
                if (targetComboBox.SelectedIndex > 1)
                {
                    te = effect[targetComboBox.SelectedIndex - 2];
                    propertyGetter = new Func<double, PropertyBase>(delegate(double x) { return m.GetProperty(te, propertyName[propertyComboBox.SelectedIndex - 1], x); });
                }
                else
                {
                    propertyGetter = new Func<double, PropertyBase>(delegate(double x) { return m.GetProperty(tl, propertyName[propertyComboBox.SelectedIndex - 1], x); });
                }
                //キーフレームを設定
                SetWiggle(keyframeRate, oct, amp, startTime, endTime, dimensionComboBox.SelectedIndex, (PropertyInterpolationType)interpolationComboBox.SelectedItem, propertyData[propertyType[propertyName[propertyComboBox.SelectedIndex - 1]]].WiggleMethod, tl, te, propertyGetter);
            }
            else
            {
                MessageBox.Show("プロパティが選択されていません", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        catch
        {
            MessageBox.Show("実行中にエラーが発生しました", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }

    //閉じるボタン押下時のイベント
    void closeButton_Click(object sentder, EventArgs e)
    {
        this.Close();
    }

    //コンポジション更新ボタン押下時のイベント
    void refreshCompositionButton_Click(object sentder, EventArgs e)
    {
        RefreshComposition();
    }

    //コンボボックス、テキストボックスでEnterを押した場合は適用ボタンを押した事にする
    void _KeyDown(object sender, KeyEventArgs e)
    {
        if (e.KeyCode == Keys.Enter)
        {
            applyButton.PerformClick();
        }
    }

    void InitializeComponent()
    {
        this.SuspendLayout();

        //各種ラベル

        Label label = new Label();
        label.AutoSize = true;
        label.Text = "コンポジション:";
        label.Location = new Point(12, 15);
        this.Controls.Add(label);

        label = new Label();
        label.AutoSize = true;
        label.Text = "レイヤー:";
        label.Location = new Point(36, 41);
        this.Controls.Add(label);

        label = new Label();
        label.AutoSize = true;
        label.Text = "対象:";
        label.Location = new Point(50, 67);
        this.Controls.Add(label);

        label = new Label();
        label.AutoSize = true;
        label.Text = "プロパティ:";
        label.Location = new Point(30, 93);
        this.Controls.Add(label);

        label = new Label();
        label.AutoSize = true;
        label.Text = "次元:";
        label.Location = new Point(50, 119);
        this.Controls.Add(label);

        label = new Label();
        label.AutoSize = true;
        label.Text = "補間方法:";
        label.Location = new Point(26, 145);
        this.Controls.Add(label);

        label = new Label();
        label.AutoSize = true;
        label.Text = "間隔:";
        label.Location = new Point(250, 15);
        this.Controls.Add(label);

        label = new Label();
        label.AutoSize = true;
        label.Text = "個/秒";
        label.Location = new Point(393, 15);
        this.Controls.Add(label);

        label = new Label();
        label.AutoSize = true;
        label.Text = "複雑度:";
        label.Location = new Point(238, 40);
        this.Controls.Add(label);

        label = new Label();
        label.AutoSize = true;
        label.Text = "強さ:";
        label.Location = new Point(254, 65);
        this.Controls.Add(label);

        label = new Label();
        label.AutoSize = true;
        label.Text = "開始時間:";
        label.Location = new Point(226, 90);
        this.Controls.Add(label);

        label = new Label();
        label.AutoSize = true;
        label.Text = "秒";
        label.Location = new Point(393, 90);
        this.Controls.Add(label);

        label = new Label();
        label.AutoSize = true;
        label.Text = "終了時間:";
        label.Location = new Point(226, 115);
        this.Controls.Add(label);

        label = new Label();
        label.AutoSize = true;
        label.Text = "秒";
        label.Location = new Point(393, 115);
        this.Controls.Add(label);

        //各種コンボボックス

        ComboBox comboBox = new ComboBox();
        comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
        comboBox.Location = new Point(87, 12);
        comboBox.Size = new Size(121, 20);
        comboBox.Name = "";
        comboBox.SelectedIndexChanged += new EventHandler(compositionComboBox_SelectedIndexChanged);
        comboBox.KeyDown += new KeyEventHandler(_KeyDown);
        this.Controls.Add(comboBox);
        compositionComboBox = comboBox;

        comboBox = new ComboBox();
        comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
        comboBox.Location = new Point(87, 38);
        comboBox.Size = new Size(121, 20);
        comboBox.SelectedIndexChanged += new EventHandler(layerComboBox_SelectedIndexChanged);
        comboBox.KeyDown += new KeyEventHandler(_KeyDown);
        this.Controls.Add(comboBox);
        layerComboBox = comboBox;

        comboBox = new ComboBox();
        comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
        comboBox.Location = new Point(87, 64);
        comboBox.Size = new Size(121, 20);
        comboBox.SelectedIndexChanged += new EventHandler(targetComboBox_SelectedIndexChanged);
        comboBox.KeyDown += new KeyEventHandler(_KeyDown);
        this.Controls.Add(comboBox);
        targetComboBox = comboBox;

        comboBox = new ComboBox();
        comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
        comboBox.Location = new Point(87, 90);
        comboBox.Size = new Size(121, 20);
        comboBox.SelectedIndexChanged += new EventHandler(propertyComboBox_SelectedIndexChanged);
        comboBox.KeyDown += new KeyEventHandler(_KeyDown);
        this.Controls.Add(comboBox);
        propertyComboBox = comboBox;

        comboBox = new ComboBox();
        comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
        comboBox.Location = new Point(87, 116);
        comboBox.Size = new Size(121, 20);
        comboBox.KeyDown += new KeyEventHandler(_KeyDown);
        this.Controls.Add(comboBox);
        dimensionComboBox = comboBox;

        comboBox = new ComboBox();
        comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
        comboBox.Location = new Point(87, 142);
        comboBox.Size = new Size(121, 20);
        comboBox.KeyDown += new KeyEventHandler(_KeyDown);
        this.Controls.Add(comboBox);
        interpolationComboBox = comboBox;

        //各種テキストボックス

        TextBox textBox = new TextBox();
        textBox.Size = new Size(100, 19);
        textBox.Location = new Point(287, 12);
        textBox.KeyDown += new KeyEventHandler(_KeyDown);
        this.Controls.Add(textBox);
        keyframeTextBox = textBox;

        textBox = new TextBox();
        textBox.Size = new Size(100, 19);
        textBox.Location = new Point(287, 37);
        textBox.KeyDown += new KeyEventHandler(_KeyDown);
        this.Controls.Add(textBox);
        octTextBox = textBox;

        textBox = new TextBox();
        textBox.Size = new Size(100, 19);
        textBox.Location = new Point(287, 62);
        textBox.KeyDown += new KeyEventHandler(_KeyDown);
        this.Controls.Add(textBox);
        ampTextBox = textBox;

        textBox = new TextBox();
        textBox.Size = new Size(100, 19);
        textBox.Location = new Point(287, 87);
        textBox.KeyDown += new KeyEventHandler(_KeyDown);
        this.Controls.Add(textBox);
        startTimeTextBox = textBox;

        textBox = new TextBox();
        textBox.Size = new Size(100, 19);
        textBox.Location = new Point(287, 112);
        textBox.KeyDown += new KeyEventHandler(_KeyDown);
        this.Controls.Add(textBox);
        endTimeTextBox = textBox;

        //各種ボタン

        Button button = new Button();
        button.Size = new Size(75, 23);
        button.Location = new Point(12, 177);
        button.Text = "適用";
        button.Click += new EventHandler(applyButton_Click);
        this.Controls.Add(button);
        applyButton = button;

        button = new Button();
        button.Size = new Size(75, 23);
        button.Location = new Point(93, 177);
        button.Text = "閉じる";
        button.Click += new EventHandler(closeButton_Click);
        this.Controls.Add(button);

        button = new Button();
        button.Size = new Size(120, 23);
        button.Location = new Point(174, 177);
        button.Text = "コンポジション更新";
        button.Click += new EventHandler(refreshCompositionButton_Click);
        this.Controls.Add(button);

        this.ClientSize = new Size(440, 212);
        this.FormBorderStyle = FormBorderStyle.FixedToolWindow;
        this.MaximizeBox = false;
        this.MinimizeBox = false;
        this.ShowIcon = false;
        this.ShowInTaskbar = false;
        this.TopMost = true;
        this.Text = "ウィグル";
        this.ResumeLayout(false);
        this.PerformLayout();
    }
}

[UsingNamespace]

NiVE2.CodeDom.Expression

}}
~
//
- effectPaddingの宣言行がコロンで終わっていたので勝手ながらセミコロンに修正しました。また、どうもコード表示で不等号の扱いにクセがあるようで、Dictionary型のpropertyDataなどの宣言や初期化が死んでます。不等号のあとに半角スペースを入れるようにすれば問題ないようですが、他にも何かあるようで、ブラウザからそのままメモ帳にコピペしても動作せず、編集画面を開いてコピーしないと動かないようです。if文とかでも不等号のあとにスペースをあけずに変数を書いてしまうとおかしくなってしまうようです。 -- [[金の髭]] &new{2010-12-13 (月) 07:04:05};
- 報告&修正ありがとうございます。codeプラグインの方を修正して不等号を&nop(&lt;);などの特殊文字で置き換えるようにしてみました。コードをテキストに保存して読み込んでも動かない件についてですが、テキストファイルからのオートメーションの読み込みがUTF-8のみに対応しているため、それ以外の文字コードで書かれたものが文字化けしているためではないかと思われます。 -- [[うp主]] &new{2010-12-13 (月) 08:42:30};
- 対応ありがとうございます。ちょっと調べてみましたが、空行に必ず半角スペースが入っているので、名前空間や参照に半角スペースの行が入ってしまい、エラーになるようです。こちらも対応できるでしょうか?というかここまで試してから報告すべきでしたね。何度もすみません。orz -- [[金の髭]] &new{2010-12-13 (月) 13:29:31};
- すみませんといいながら更にもう1つ・・・。質問箱などのように、投稿ごとにリンクというかラベルがつくようになると嬉しいです。 -- [[金の髭]] &new{2010-12-15 (水) 00:08:03};
- UI付きかっこいいです・・・今のところ金の髭さんのおっしゃる通りWikiからコピペするとスペースが入ってエラーを吐くようです。編集からコピペすると上手く動くようです。 -- [[K]] &new{2010-12-15 (水) 00:20:06};
- 空白行のスペースを追加しないようにしてみましたが、firefox関連のなんらかの問題の対策用に空白行にスペース追加されていたようなので、もしかするとこの変更によってfirefoxでレイアウトが崩れたりするという問題があるかもしれません。 -- [[うp主]] &new{2010-12-15 (水) 13:35:30};
- 対応ありがとうございます。お時間のある時で構いませんので記事ごとのリンク自動生成の件も対応していただければ幸いです。 -- [[金の髭]] &new{2010-12-15 (水) 22:32:52};
- とりあえず、原因とおぼしき部分は修正しましたが、なぜか最新の投稿のみアンカーがつかないようです。原因がわかり次第修正しますが、ちょっと時間がかかりそうです。 -- [[うp主]] &new{2010-12-16 (木) 03:19:05};
- ありがとうございます。色々すみません。 -- [[金の髭]] &new{2010-12-16 (木) 08:26:31};

#comment_kcaptcha

**キネティックタイポグラフィーとかに使ってほしいオートメーション [#q3105411]
>[[K]] (2010-12-08 (水) 01:42:02)~
~
オートメーションなのですがここに書いてよろしいのでしょうか・・・~
~
キネタイをやったとき歌詞などのテキストレイヤーを一行一行追加していくのがめんどくさくなったのでつくりました。~
~
テキストファイルを読み込んで、各行に分割してテキストレイヤーを作ります。~
~
実行する前に~
MainCode直下の~
string compName = "Comp 2";~
の部分を追加したいコンポジション名に書き換えてください。~
~
あと読み込めるテキストの改行コードはCrLfのみとしました。~
~
文字コードを判別するメソッドはまるまるパクリですw~
~
#code(csharp, コード){{

[MethodCode]

/// <summary>
/// 文字コードを判別する
/// </summary>
/// <remarks>
/// Jcode.pmのgetcodeメソッドを移植したものです。
/// Jcode.pm(http://openlab.ring.gr.jp/Jcode/index-j.html)
/// Jcode.pmのCopyright: Copyright 1999-2005 Dan Kogai
/// </remarks>
/// <param name="byts">文字コードを調べるデータ</param>
/// <returns>適当と思われるEncodingオブジェクト。
/// 判断できなかった時はnull。</returns>
System.Text.Encoding GetCode(byte[] bytes)
{
    const byte bEscape = 0x1B;
    const byte bAt = 0x40;
    const byte bDollar = 0x24;
    const byte bAnd = 0x26;
    const byte bOpen = 0x28;    //'('
    const byte bB = 0x42;
    const byte bD = 0x44;
    const byte bJ = 0x4A;
    const byte bI = 0x49;

    int len = bytes.Length;
    byte b1, b2, b3, b4;

    //Encode::is_utf8 は無視

    bool isBinary = false;
    for (int i = 0; i < len; i++)
    {
        b1 = bytes[i];
        if (b1 <= 0x06 || b1 == 0x7F || b1 == 0xFF)
        {
            //'binary'
            isBinary = true;
            if (b1 == 0x00 && i < len - 1 && bytes[i + 1] <= 0x7F)
            {
                //smells like raw unicode
                return System.Text.Encoding.Unicode;
            }
        }
    }
    if (isBinary)
    {
        return null;
    }

    //not Japanese
    bool notJapanese = true;
    for (int i = 0; i < len; i++)
    {
        b1 = bytes[i];
        if (b1 == bEscape || 0x80 <= b1)
        {
            notJapanese = false;
            break;
        }
    }
    if (notJapanese)
    {
        return System.Text.Encoding.ASCII;
    }

    for (int i = 0; i < len - 2; i++)
    {
        b1 = bytes[i];
        b2 = bytes[i + 1];
        b3 = bytes[i + 2];

        if (b1 == bEscape)
        {
            if (b2 == bDollar && b3 == bAt)
            {
                //JIS_0208 1978
                //JIS
                return System.Text.Encoding.GetEncoding(50220);
            }
            else if (b2 == bDollar && b3 == bB)
            {
                //JIS_0208 1983
                //JIS
                return System.Text.Encoding.GetEncoding(50220);
            }
            else if (b2 == bOpen && (b3 == bB || b3 == bJ))
            {
                //JIS_ASC
                //JIS
                return System.Text.Encoding.GetEncoding(50220);
            }
            else if (b2 == bOpen && b3 == bI)
            {
                //JIS_KANA
                //JIS
                return System.Text.Encoding.GetEncoding(50220);
            }
            if (i < len - 3)
            {
                b4 = bytes[i + 3];
                if (b2 == bDollar && b3 == bOpen && b4 == bD)
                {
                    //JIS_0212
                    //JIS
                    return System.Text.Encoding.GetEncoding(50220);
                }
                if (i < len - 5 &&
                    b2 == bAnd && b3 == bAt && b4 == bEscape &&
                    bytes[i + 4] == bDollar && bytes[i + 5] == bB)
                {
                    //JIS_0208 1990
                    //JIS
                    return System.Text.Encoding.GetEncoding(50220);
                }
            }
        }
    }

    //should be euc|sjis|utf8
    //use of (?:) by Hiroki Ohzaki <ohzaki@iod.ricoh.co.jp>
    int sjis = 0;
    int euc = 0;
    int utf8 = 0;
    for (int i = 0; i < len - 1; i++)
    {
        b1 = bytes[i];
        b2 = bytes[i + 1];
        if (((0x81 <= b1 && b1 <= 0x9F) || (0xE0 <= b1 && b1 <= 0xFC)) &&
            ((0x40 <= b2 && b2 <= 0x7E) || (0x80 <= b2 && b2 <= 0xFC)))
        {
            //SJIS_C
            sjis += 2;
            i++;
        }
    }
    for (int i = 0; i < len - 1; i++)
    {
        b1 = bytes[i];
        b2 = bytes[i + 1];
        if (((0xA1 <= b1 && b1 <= 0xFE) && (0xA1 <= b2 && b2 <= 0xFE)) ||
            (b1 == 0x8E && (0xA1 <= b2 && b2 <= 0xDF)))
        {
            //EUC_C
            //EUC_KANA
            euc += 2;
            i++;
        }
        else if (i < len - 2)
        {
            b3 = bytes[i + 2];
            if (b1 == 0x8F && (0xA1 <= b2 && b2 <= 0xFE) &&
                (0xA1 <= b3 && b3 <= 0xFE))
            {
                //EUC_0212
                euc += 3;
                i += 2;
            }
        }
    }
    for (int i = 0; i < len - 1; i++)
    {
        b1 = bytes[i];
        b2 = bytes[i + 1];
        if ((0xC0 <= b1 && b1 <= 0xDF) && (0x80 <= b2 && b2 <= 0xBF))
        {
            //UTF8
            utf8 += 2;
            i++;
        }
        else if (i < len - 2)
        {
            b3 = bytes[i + 2];
            if ((0xE0 <= b1 && b1 <= 0xEF) && (0x80 <= b2 && b2 <= 0xBF) &&
                (0x80 <= b3 && b3 <= 0xBF))
            {
                //UTF8
                utf8 += 3;
                i += 2;
            }
        }
    }
    //M. Takahashi's suggestion
    //utf8 += utf8 / 2;

    System.Diagnostics.Debug.WriteLine(
        string.Format("sjis = {0}, euc = {1}, utf8 = {2}", sjis, euc, utf8));
    if (euc > sjis && euc > utf8)
    {
        //EUC
        return System.Text.Encoding.GetEncoding(51932);
    }
    else if (sjis > euc && sjis > utf8)
    {
        //SJIS
        return System.Text.Encoding.GetEncoding(932);
    }
    else if (utf8 > euc && utf8 > sjis)
    {
        //UTF8
        return System.Text.Encoding.UTF8;
    }

    return null;
}
// ----------------------------------------------------------
// ◆テキスト入力ダイアログを表示し指定したテキストファイルを読み込む。
// ○返り値
// 取得されたテキストファイルの内容
// 
// ----------------------------------------------------------
String GetTextFile(){
	//最後に返り値を入れる用
	string retStr= "";

	//ファイル入力ダイアログのインスタンス化
	OpenFileDialog ofd = new OpenFileDialog();

	//タイトルの設定
	ofd.Title = "改行分割するテキストファイルを選択してください";

	//ダイアログボックスを閉じる前に現在のディレクトリを復元するようにする
	ofd.RestoreDirectory = true;

	//[ファイルの種類]に表示される選択肢を指定する
	ofd.Filter ="txt files (*.txt)|*.txt|All files (*.*)|*.*";

	//[ファイルの種類]ではじめにtxt filesが選択されるようにする
	ofd.FilterIndex = 1;

	//ダイアログを表示する
	if (ofd.ShowDialog() == DialogResult.OK)
	{
		//OKボタンがクリックされたとき
		//選択されたファイルを読み取り専用で開く
		System.IO.Stream stream;
		stream = ofd.OpenFile();
		if (stream != null)
		{




			//テキストファイルを開く
			System.IO.FileStream fs = new System.IO.FileStream(ofd.FileName, System.IO.FileMode.Open,System.IO.FileAccess.Read);
			byte[] bs = new byte[fs.Length];
			//byte配列に読み込む
			fs.Read(bs, 0, bs.Length);
			fs.Close();
			
			//文字コードを取得する
			System.Text.Encoding enc = GetCode(bs);

			//デコードして返り値を退避
			retStr  = enc.GetString(bs);



		}
	}

	//返す
	return retStr;

}

// ----------------------------------------------------------
// ◆指定したコンポジション名を持つコンポジションの取得
// ○引数
// IComposition[] comps
// 比較するコンポジション配列
// 
// string compName
// テキストレイヤーを追加したいコンポジション名(指定したコンポジション名)
// 
// ○返り値
// 指定したコンポジション名(compName)と同名のコンポジション
// 
// ----------------------------------------------------------

IComposition GetTargetComp(IComposition[] comps,string compName)
{
	// 指定コンポジション名を持つコンポジションの添え字を取得
	int compNum = 0;
	for (int i = 0; i < comps.Length; i++)
	{
		if (compName == comps[i].Setting.Name)
		{
			compNum = i;
			break;
	    }
	}
	return comps[compNum];
}
// ----------------------------------------------------------
// ◆テキストレイヤーを追加し引数のstring(lyric)をリネーム、ソーステキストに設定
// ○引数
// IAutomationManager manager
// これ渡さないとうごかないので。
// 
// IComposition targetComp
// 追加対象のコンポジション
// 
// string lyric
// リネーム、ソーステキストにプロパティを追加する歌詞(lyric)
// 
// ○返り値
// なし、コンポジションにレイヤーが追加される
// ----------------------------------------------------------
void SetTextLayer(IAutomationManager manager, IComposition targetComp,string lyric)
{
//テキストレイヤーを作成しtextLayerに入れる
ILayer textLayer = manager.AddText(targetComp);

//レイヤー名を歌詞にする
manager.ChangeLayerName(textLayer,lyric);

//テキストレイヤーのテキストに歌詞を入れる
StringProperty strp = new StringProperty("ソーステキスト",lyric );
KeyFrame strk = new KeyFrame(0, strp, PropertyInterpolationType.None);
manager.AddKeyFrame(textLayer, strk);

}

[MainCode]
// 注意:実行前に入力すること!
// コンポジション名
string compName = "Comp 2";

// テキストファイルの内容取得
string lyric = GetTextFile();

//改行コード、デリミタの設定
char[] delimiterChars = { '\r', '\n'};
// テキストファイルの内容を配列に分割
string[] lyrics = lyric.Split(delimiterChars);

// コンポジション配列取得
IComposition[] comps = manager.GetComposition();

// 対象のコンポジションの取得
IComposition targetComp = GetTargetComp(comps,compName);

//テキストファイルの行数分だけループ
for (int i=0; i < lyrics.Length; i++){
	//lyrics[i]が空文字("")ならレイヤーを追加しない
	if(lyrics[i].Length!=0){
		//テキストレイヤーの設置、リネームとプロパティの追加
		SetTextLayer(manager, targetComp,lyrics[i]);
	}
}
 

//でばっぐよう
//MessageBox.Show("テキスト");


}}
~

//
- 長すぎですなwwwwごめんなさいw -- [[K]] &new{2010-12-08 (水) 01:42:50};

#comment_kcaptcha

**クロスフェード [#q69ee8a6]
> (2010-12-06 (月) 03:05:24)~
~
このエクスプレッションをはりつけたレイヤー同士のかぶった部分に、自動でクロスフェードをかけます。かならずフェードアウトするレイヤーのひとつ下に、フェードインするレイヤーをおいてください。~
デフォルトでは、フェードインするレイヤーは実際にはフェードイン処理していません。透明部分があるレイヤーがフェードアウトする場合は、フェードインする側のレイヤーのエクスプレッションのfadeinの値をtrueに変更してみてください。~
~
#code(csharp){{
[MainCode]
//フェードインはデフォルトで無効(有効にするときはfalseをtrueに変更する)
bool fadein = false;

// エフェクトの不透明度のプロパティを取得
NumberProperty opaque = (NumberProperty)property.GetProperty(thisItem, "不透明度");

// クロスフェードさせる相手レイヤーを探す
// (自分のレイヤーの上下のレイヤーを探すだけ)
ILayer layer = (ILayer)thisItem;
ILayer fin = null, fout = null;
ILayer[] ls = layer.Composition.GetLayer();
for (int i = 0; i < ls.Length; i++) {
    if (ls[i].Equals(layer) == true) {
        if (i > 0)
            fout = ls[i - 1];
        if (i < ls.Length - 1)
            fin = ls[i + 1];
        break;
    }
}

// クロスフェード処理

// ワールド時間を求める
double wtime = layer.ToWorldTime(time);
// レイヤーの開始・終了時間のワールド時間を求める
double start = layer.Position + layer.InPoint;
double end = layer.Position + layer.OutPoint;

// フェードイン
if (fout != null && fadein == true) {
    // 相手レイヤーの開始・終了時間のワールド時間を求める
    double fstart = fout.Position + fout.InPoint;
    double fend = fout.Position + fout.OutPoint;
    // 重なっている部分があったらフェードイン処理
    if (start < fend && wtime < fend)
        opaque.DoubleValue = (wtime - start) / (fend - start) * 100;
} 
// フェードアウト
if (fin != null) {
    // 相手レイヤーの開始・終了時間のワールド時間を求める
    double fstart = fin.Position + fin.InPoint;
    double fend = fin.Position + fin.OutPoint;
    // 重なっている部分があったらフェードアウト処理
    if (fstart < end && fstart < wtime)
        opaque.DoubleValue = (end - wtime) / (end - fstart) * 100;
} 
// 0-100に丸める
opaque.DoubleValue = Math.Max(Math.Min(opaque.DoubleValue, 100), 0);

// 変更したプロパティを反映
property.SetProperty(thisItem, opaque);
}}
~

//

#comment_kcaptcha

**フェードイン・フェードアウト [#r46e6c8d]
> (2010-12-05 (日) 21:22:48)~
~
不透明度のパラメータが存在するエフェクトまたはレイヤーの開始点から、終了点までの1秒にフェード処理を行います。~
~
#code(csharp){{
[MainCode]
// フェードイン・フェードアウトにかかる時間(秒)
double fadeinterval = 1.0;

ILayer layer;
if (thisItem is IEffect) {
    // このエクスプレッションはエフェクトに適用されている
    // エフェクトのあるレイヤーの情報を取得
    IExpressionItem thisLayer = thisItem.ParentItem;
    layer = (ILayer)thisLayer;
} else {
    // このエクスプレッションはレイヤーに適用されている
    layer = (ILayer)thisItem;
}

// エフェクトの不透明度のプロパティを取得
NumberProperty opaque = (NumberProperty)property.GetProperty(thisItem, "不透明度");

// フェードイン処理
if (layer.InPoint + fadeinterval > time)
    opaque.DoubleValue = (time - layer.InPoint) / fadeinterval * 100;

// フェードアウト処理
if (layer.OutPoint - fadeinterval < time)
    opaque.DoubleValue = (layer.OutPoint - time) / fadeinterval * 100;

// 変更したプロパティを反映
property.SetProperty(thisItem, opaque);
}}
~

//

#comment_kcaptcha

**サンプルいくつか [#b4b29e7d]
>[[うp主]] (2010-12-05 (日) 16:39:09)~
~
投稿テストもかねていくつか。~
~
レイヤーの位置にWiggleを掛ける~
#code(csharp){{
[MainCode]
//ランダムシード
int seed = thisItem.GetHashCode();
//複雑度
int oct = 6;
//振幅
Vertex amp = new Vertex(100.0, 100.0, 100.0);
//振動の速度
double speed = 15.0;
//展開
float x = (float)((time * speed) % 360.0);
//位置のプロパティ
VertexProperty position = (VertexProperty)property.GetProperty(thisItem, "位置");

//ExpressionUtils.Wiggleを使って振動させる
position.VertexValue = ExpressionUtils.Wiggle(seed, x, oct, position.VertexValue, amp);
property.SetProperty(thisItem, position);
}}
~
イージングを適用しつつ移動~
#code(csharp){{
[MainCode]
//位置のプロパティ
VertexProperty position = (VertexProperty)property.GetProperty(thisItem, "位置");
//開始時間
double startTime = 0.0;
//終了時間
double endTime = 2.0;
//開始位置
Vertex startPosition = position.VertexValue;
//終了位置
Vertex endPosition = Vertex.Add(startPosition, new Vertex(640.0, 480.0, 0.0));
//加速度
double ease = 2.0;

position.VertexValue = ExpressionUtils.Ease(startTime, startPosition, endTime, endPosition, time, ease);
property.SetProperty(thisItem, position);
}}
~
コンポジション内のレイヤーを円運動させる~
#code(csharp){{
[MainCode]
//このコンポジション内の全てのレイヤー
ILayer[] layer = ((IComposition)thisItem.ParentItem).GetLayer();
//レイヤーごとの開始角度
double rad = 360.0 / (double)(layer.Length - 1);
//円の半径
Vertex radius = new Vertex(0.0, 200.0, 0.0);
//各軸それぞれの回転
double xMove = time * 180.0;
double yMove = time * 180.0;
double zMove = time * 90.0;
//位置計算用の行列
Matrix4D matrix = new Matrix4D();

for (int i = 0, c = 0; i < layer.Length; i++)
{
    //Nullオブジェクトやカメラなどを除く
    if (!layer[i].IsSpecialItem)
    {
        //行列を初期化
        matrix.LoadIdentity();
        //回転
        matrix.Rotate(xMove, yMove, rad * i + zMove, true);
        VertexProperty pos = (VertexProperty)property.GetProperty(layer[i], "位置");
        pos.VertexValue = Vertex.Add(pos.VertexValue, matrix.Transform(radius));
        property.SetProperty(layer[i], pos);
        c++;
    }
}
}}
~

//
- 追記: 円運動のエクスプレッションを使用する際は、Nullオブジェクトかなにかをコンポジションの一番下において、そこにエクスプレッションをコピペして下さい。 -- [[うp主]] &new{2010-12-05 (日) 16:50:29};
- カメラを400x300x0から400x300x-1000までイージングを適用しつつ移動させたいんですが、上記のコードをコピペして適宜位置の値を変えて使えばよろしいのでしょうか? --  &new{2010-12-12 (日) 23:08:00};

#comment_kcaptcha

**てすと [#z773fcc9]
> (2010-12-05 (日) 16:17:23)~
~
テスト~
#code(csharp){{
//test
namespace Test
{
    class TestClass
    {
        static void Main(string[] args)
        {
            System.Windows.Forms.MessageBox("Hello World!");
        }
    }
} 
}}
~

//

#comment_kcaptcha

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS