Community
Maya Shading, Lighting and Rendering
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya materials topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

render nParticle instances with Arnold

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
BurkhardRammner
480 Views, 9 Replies

render nParticle instances with Arnold

Hi,

I'm still on Maya2020.

Trying to render nParticle instances with Arnold.

Generally this works (as opposed to rendering using the old Maya renderer).
But I cannot make the instance invisible (setAttr visibilty of its transform node).
The visibility for Arnold seems to depend only on the visibility of the original nParticles transform node.
Is this so?
How can I hide individual nParticle instances?

Thanks!

9 REPLIES 9
Message 2 of 10

Is this FIXED in Maya2024?

edit: renderSetup layers do also NOT work

Message 3 of 10


@BurkhardRammner wrote:

Hi,

I'm still on Maya2020.

Trying to render nParticle instances with Arnold.

Generally this works (as opposed to rendering using the old Maya renderer).
But I cannot make the instance invisible (setAttr visibilty of its transform node).
The visibility for Arnold seems to depend only on the visibility of the original nParticles transform node.
Is this so?
How can I hide individual nParticle instances?

Thanks!


There's no way in Maya to access the parameters of the instances eg no Maya nodes
You could do something with opacityPP

I can set up an Arnold operator that hides specific particles, but that's by instance index eg instance[993], so I don't think there's a way to relate that back to the particles you see in the viewport.



// Stephen Blair
// Arnold Renderer Support
Message 4 of 10

Hi Stephen,

opacityPP doesn't make sense as this modifies the particle shape data and thus all instances are affected.

And it does make no sense for Arnold to enable particle instance rendering but then ignore whether the particles' transform node is visible or not. I would consider this a bug. This instance rendering feature is totally useless.

Message 5 of 10

..you mean its possible via operators?

How would I do that?

Thanks!

Message 6 of 10

If you are using MtoA 5.3 or later, the nParticle instances are rendered as an Arnold instancer object.
And the instancer has an array of visibility settings, one per instance. So I used that. Not sure if this will be useful though. I tried using particleID but that didn't work.

 

mtoa_nparticles_instancer.jpg



// Stephen Blair
// Arnold Renderer Support
Message 7 of 10

Stephen,
thank you for your answer.

Unfortunately, that was not what I meant ; )

Here's some mel:

 

string $nParticles[] = nParticle( "-jbp", 0, 0, 0, "-nj", 2, "-jr", 0, "-c", 1 ) ; // create nParticle
string $instances[] = instance( $nParticles[0] ); // instance the nParticle
move( "-r", 0, 0, 10, $instances[0] ); // offset the instance

 

Its about nParticle instances, not instances of meshes using nParticles and the instancer node...

If you hide the 'original' nParticle, all instances will not be rendered by Arnold.

 

hide ( $nParticles[0] );

 

cheers!

Message 8 of 10

...ah, the story was not at its end (is it ever using some Maya functionality? I'm so sick of it)
1. - if the 'original' nParticle is hidden (or any of its parents) -> all its instances are also hidden

    - if a nParticle instance is hidden -> only exactly this instance is hidden, yes...so -> fine

2. - if a nParticle instance is translated (not world zero) and then the 'original' nParticle is translated -> fine

    - if a nParticle instance is rotated and then the 'original' nParticle is translated -> the instance is also transformed in some weird direction -> what the heck?!?!?!? Who can even think about implementing such a behavior? Is that by evil design?

 

edit: I meant the rendered nParticles, not the ones in the viewport (these have correct transformations)

edit2: you have to close and reopen the Arnold render view to be sure to see the updated transformations

 

Could anyone in charge here me tell how I can fix or work around this, please!

 

example:

 

{
string $nParticles[] = particle(   "-jbp", 0, 0, 0, "-nj", 2, "-jr", 0, // create nParticle
            "-jbp", 0, 0, 2.5, "-nj", 2, "-jr", 0, 
            "-jbp", 0, 0, 5, "-nj", 2, "-jr", 0, 
            "-jbp", 0, 0, 7.5, "-nj", 2, "-jr", 0, 
            "-jbp", 0, 0, 10, "-nj", 2, "-jr", 0, "-c", 1) ;
setAttr( $nParticles[0]+".particleRenderType", 4 );

string $instances[] = instance( $nParticles[0] ); // instance the nParticle

move( "-r", 20, 0, 0, $nParticles[0] ); // T offset the original
move( "-r", 10, 0, 0, $instances[0] ); // T offset the instance
rotate( "-r", 0, 45, 0, $instances[0] ); // R offset the instance
}
Message 9 of 10


@BurkhardRammner wrote:

Stephen,
thank you for your answer.

Unfortunately, that was not what I meant ; )

Here's some mel:

 

string $nParticles[] = nParticle( "-jbp", 0, 0, 0, "-nj", 2, "-jr", 0, "-c", 1 ) ; // create nParticle
string $instances[] = instance( $nParticles[0] ); // instance the nParticle
move( "-r", 0, 0, 10, $instances[0] ); // offset the instance

 

Its about nParticle instances, not instances of meshes using nParticles and the instancer node...

If you hide the 'original' nParticle, all instances will not be rendered by Arnold.

 

hide ( $nParticles[0] );

 

cheers!


Ok, instances of nParticles, not nParticle instances.
That's easier to workaround with an operator (than the nParticle instances).

All the instances end up with no visibility, so you can make them visible like this:

Selection: *.(@node=='ginstance')

Assignment: visibility=255


In the UI, that looks like:

mtoa_instances_of_nparticles.jpg



// Stephen Blair
// Arnold Renderer Support
Message 10 of 10

Stephen,

thank you..that works!

I found out what happens to the instances when the original nParticle object is rotated:
all points of the instanced nParticle are rotated separately around world zero with the same rotation value.
So it might make sense to tell your coders to fix this...
After the past bug report system was gone, I stopped reporting bugs myself, because I was too stupid to figure out
how I could do it then.

thanks again!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report