Ok, will add this to our "todo" list.
Announcement
Collapse
No announcement yet.
Python scene access list
Collapse
X
-
Ok, thank you !
I have an other question to ask :
How could we "interpolate" in post translate python script ?
Like in this :
Node pSphereShape1@node {
transform=interpolate(
(2, Transform(Matrix(Vector(1, 0, 0), Vector(0, 1, 0), Vector(0, 0, 1)), Vector(0, 0, -3.228602899708137))),
(3, Transform(Matrix(Vector(1, 0, 0), Vector(0, 1, 0), Vector(0, 0, 1)), Vector(0, 0, -6.457205799416276)))
);
nsamples=interpolate(
(3, 0)
);
}
Comment
-
-
Ok,
I understand very well. I knew that one would be harder to do.
So we might have a workaround that could work for us and solve a lot of things :
Having the possibility to add a string or a StringIO to the addSceneContent variable rather than a scenefile !!!
What do you think about this ?
Thanks,
Max
Comment
-
Hi,
I would like to know if there is any news about my previous asks ?
Also, I have another request about lists in python scene access.
It seems that we cannot access to positions in ramps.
Here is an example:
def postTranslateScript():
import vray
ramp = vray.utils.findByName('ramp1')[0] #(Type is 'TexRamp')
positions = ramp.get('positions')
print positions # prints "[0.0, 0.5, 1.0]"
# This line warns: // Warning: line 1: Invalid value given for parameter "positions" in plugin "ramp1". //
ramp.set('positions', [0.0, 0.5, 1.0])
Thanks in advance ,
Max
Comment
-
Originally posted by CGMas View PostHi,
I would like to know if there is any news about my previous asks ?
Also, I have another request about lists in python scene access.
It seems that we cannot access to positions in ramps.
Here is an example:
def postTranslateScript():
import vray
ramp = vray.utils.findByName('ramp1')[0] #(Type is 'TexRamp')
positions = ramp.get('positions')
print positions # prints "[0.0, 0.5, 1.0]"
# This line warns: // Warning: line 1: Invalid value given for parameter "positions" in plugin "ramp1". //
ramp.set('positions', [0.0, 0.5, 1.0])
Thanks in advance ,
Max
Maybe now there's an answer to that question ?
Thanks a lot,
Max
Comment
-
Hm, this is a special parameter. It can act like a list of floats, but the python scene access doesn't know that. We can make it work in this way:
Code:from vray.utils import * ramp = findByName('ramp1')[0] positions = ramp.get('positions') texFloat1 = create("TexFloatOp", "rampPos1") texFloat1.set("float_a", 0.5) texFloat2 = create("TexFloatOp", "rampPos2") texFloat2.set("float_a", 0.0) ramp.set('positions', [texFloat1, texFloat2])
V-Ray/PhoenixFD for Maya developer
Comment
-
Hi,
Another list I have difficulties to deal with is the object select "ids" list.
If I do something like this:
import vray.utils
obj_sel = vray.utils.findByType('RenderChannelObjectSelect')[0]
before_ids = obj_sel.get('ids')
obj_sel.set('ids', [3, 1] )
after_ids = obj_sel.get('ids')
print before_ids
print after_ids
Only the first value of the list is set.
Maybe I've missed something...
Thanks,
Max
Comment
Comment