Announcement

Collapse
No announcement yet.

VRay and maxscript issues

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    like tmp = for i = 1 to numEffects collect (getEffect i)

    result:
    #(VRay_blah:nameOfVRay_blah)

    tmp = for i in tmp collect (copy i)

    result:

    #(undefined)

    Comment


    • #17
      just tried with Lens_effects and it works, so it is a Vray render effects problem

      Comment


      • #18
        sorry, no it doesn't work at all
        Max refuse to copy render effects

        I will try to find a way to get the subanim object as a workaround...

        Comment


        • #19
          just test

          copy rootScene.Render_Effects[1]

          no workaround....

          Please help if you can!!!

          Comment


          • #20
            Untested, but this might work in some cases, it creates copies of the underlying ParamBlock2's and puts them in a new identical effect:

            Code:
            fn copyEffect effect =
            (
            	local ef = (classof effect)()
            	local deps = refs.dependsOn effect
            	for r = 1 to deps.count do
            	(
            		if (isKindOf deps[r] ParamBlock2) do
            		(
            			refs.replaceReference ef r (copy deps[r])
            		)
            	)
            	ef
            )
            Then again, might not work in other cases, like effects with non PB2 dependencies.
            Last edited by RotemS; 25-05-2016, 04:58 AM.

            Comment


            • #21
              Left work already. I was actually thinking of a workaround by creating a new effect, copy/paste the props of the old one, copy the new one and delete it to have only one instance in the CA

              Comment


              • #22
                Thanks a lot for the help!

                Comment


                • #23
                  It almost works, very interesting this refs thing...
                  but if the number of PB2 is different it doesn't, without sending any error.
                  For example lens effect is adding a NEW block with each element you add to it.

                  Ok I give up on that for now, not super used anyway but frustrating.

                  The help file is stating in little font at the bottom of the page:
                  NOTE:
                  Unlike most MAXWrapper objects, you can not copy a RenderEffect.

                  Comment

                  Working...
                  X