{"id":780,"date":"2008-11-14T21:33:25","date_gmt":"2008-11-14T13:33:25","guid":{"rendered":"http:\/\/www.fangloong.com\/blog\/2008\/11\/14\/particle-expression-script\/"},"modified":"2008-11-29T12:30:23","modified_gmt":"2008-11-29T04:30:23","slug":"particle-expression-script","status":"publish","type":"post","link":"http:\/\/www.fangloong.com\/blog\/2008\/11\/14\/particle-expression-script\/","title":{"rendered":"Particle expression script &#8230;."},"content":{"rendered":"<p>PARTICLES<br \/>\n<font color=\"#ffe400\">  A)Random Objects <\/font><\/p>\n<p>1.\u00a0\u00a0 \u00a0Create particle instancer with all the objects selected.<br \/>\n2.\u00a0\u00a0 \u00a0Create custom attribute (custom_index) \u2013float \u2013per particle array<br \/>\n3.\u00a0\u00a0 \u00a0Write creation expression \u2013 particleShape1.custom_index = rand(0,x)  ( <em>particleShape1<\/em> &gt;change to particle name )<\/p>\n<p><font color=\"#ffe400\">B)Random Scale for Instanced Objects<\/font><\/p>\n<p>1. Create a new custom attribute (customScale) for the particle object -vector -per particle array<br \/>\n2. Write a creation expression for this new attribute.<\/p>\n<p>particleShape1.customScale = rand(0.1,1); ( <em>particleShape1<\/em> &gt;change to particle name )<\/p>\n<p>or<\/p>\n<p>float $wateva = rand(1,2)<br \/>\nparticleShape1.customScale = &lt;&lt;$wateva,$wateva,$wateva&gt;&gt; ( <em>particleShape1<\/em> &gt;change to particle name )<\/p>\n<p><font color=\"#ffe400\">C)Random Orientation and Spinning Instanced Objects<\/font><\/p>\n<p>1. Create new custom attribute (customRotation) for the particle object -vector -per particle array<br \/>\n2. And another (randomNumber) \u2013float \u2013 per particle array<br \/>\n3. Write expressions for these:<\/p>\n<p>Creation:<\/p>\n<p>particleShape1.randomNumber = rand(-0.001,0.001); (<em> particleShape1<\/em> &gt;change to particle name )<\/p>\n<p>particleShape1.customRotation = &lt;&lt;rand(360),rand(360),rand(360)&gt;&gt; ( <em>particleShape1<\/em> &gt;change to particle name )<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PARTICLES A)Random Objects 1.\u00a0\u00a0 \u00a0Create particle instancer with all the objects selected. 2.\u00a0\u00a0 \u00a0Create custom attribute (custom_index) \u2013float \u2013per particle array 3.\u00a0\u00a0 \u00a0Write creation expression \u2013 particleShape1.custom_index = rand(0,x) ( particleShape1 &gt;change to particle name ) B)Random Scale for Instanced &hellip; <a href=\"http:\/\/www.fangloong.com\/blog\/2008\/11\/14\/particle-expression-script\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-780","post","type-post","status-publish","format-standard","hentry","category--works"],"_links":{"self":[{"href":"http:\/\/www.fangloong.com\/blog\/wp-json\/wp\/v2\/posts\/780","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.fangloong.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.fangloong.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.fangloong.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.fangloong.com\/blog\/wp-json\/wp\/v2\/comments?post=780"}],"version-history":[{"count":0,"href":"http:\/\/www.fangloong.com\/blog\/wp-json\/wp\/v2\/posts\/780\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.fangloong.com\/blog\/wp-json\/wp\/v2\/media?parent=780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.fangloong.com\/blog\/wp-json\/wp\/v2\/categories?post=780"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.fangloong.com\/blog\/wp-json\/wp\/v2\/tags?post=780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}