Hello everyone!
I'm a bit stuck with the vrayMeshImport() function. I have multiple vrayproxies in my scene that I try to import as editable mesh. I need to have every editable mesh in a variable in order to work with those later.
Everytime I get the vrayMeshImport() in a loop the result I have is: iteration of a mesh = vrayproxy ^ selection.count. Example, I have 2 vrayproxies I'll get: 2 meshes of VrayProxy001 and 2 meshes of VrayProxy002. If I have 3 vrayproxies I'll get: 3 meshes of Vrayproxy001, 3 meshes of Vrayproxy002, 3 meshes of Vrayproxy003, ..and so on.
I currently have 3 vrayproxies: VRayProxy001, VRayProxy002, VRayProxy003
My code:
log:
My array newMesh contains 9 values (instead of 3!) and in my viewport I have 3 meshes for every vrayproxy ( = 9 meshes in total instead of 3).
Can someone help me out with this? I don't understand why the selection.count influences the number of importation of a vrayproxy. I don't know if it's a issue or not?
Thank you
I'm a bit stuck with the vrayMeshImport() function. I have multiple vrayproxies in my scene that I try to import as editable mesh. I need to have every editable mesh in a variable in order to work with those later.
Everytime I get the vrayMeshImport() in a loop the result I have is: iteration of a mesh = vrayproxy ^ selection.count. Example, I have 2 vrayproxies I'll get: 2 meshes of VrayProxy001 and 2 meshes of VrayProxy002. If I have 3 vrayproxies I'll get: 3 meshes of Vrayproxy001, 3 meshes of Vrayproxy002, 3 meshes of Vrayproxy003, ..and so on.
I currently have 3 vrayproxies: VRayProxy001, VRayProxy002, VRayProxy003
My code:
newMesh = #()
f = getCurrentSelection()
for i = 1 to f.count do
(
print (i as string)
obj = f[i]
print "selected obj: "
print obj
newMesh[i] = vrayMeshImport obj
newMesh[i].name = obj.name
print "newMesh: "
print NewMesh[i]
)
print "-----"
newMesh
f = getCurrentSelection()
for i = 1 to f.count do
(
print (i as string)
obj = f[i]
print "selected obj: "
print obj
newMesh[i] = vrayMeshImport obj
newMesh[i].name = obj.name
print "newMesh: "
print NewMesh[i]
)
print "-----"
newMesh
#($VRayProxy:VRayProxy002 @ [105.451233,63.242535,-15.809784], $VRayProxy:VRayProxy003 @ [105.451233,148.749832,-15.809784], $VRayProxy:VRayProxy001 @ [121.075500,-3.243168,-15.809784])
#()
"1"
"selected obj: "
$VRayProxy:VRayProxy002 @ [105.451233,63.242535,-15.809784]
"newMesh: "
$Editable_Mesh:VRayProxy002 @ [0.000000,0.000000,0.000000]
$Editable_Mesh:VRayProxy002 @ [0.000000,0.000000,0.000000]
$Editable_Mesh:VRayProxy002 @ [0.000000,0.000000,0.000000]
"2"
"selected obj: "
$VRayProxy:VRayProxy003 @ [105.451233,148.749832,-15.809784]
"newMesh: "
$Editable_Mesh:VRayProxy003 @ [0.000000,0.000000,0.000000]
$Editable_Mesh:VRayProxy003 @ [0.000000,0.000000,0.000000]
$Editable_Mesh:VRayProxy003 @ [0.000000,0.000000,0.000000]
"3"
"selected obj: "
$VRayProxy:VRayProxy001 @ [121.075500,-3.243168,-15.809784]
"newMesh: "
$Editable_Mesh:VRayProxy001 @ [0.000000,0.000000,0.000000]
$Editable_Mesh:VRayProxy001 @ [0.000000,0.000000,0.000000]
$Editable_Mesh:VRayProxy001 @ [0.000000,0.000000,0.000000]
OK
"-----"
"-----"
#(#($Editable_Mesh:VRayProxy002 @ [0.000000,0.000000,0.000000], $Editable_Mesh:VRayProxy002 @ [0.000000,0.000000,0.000000], $Editable_Mesh:VRayProxy002 @ [0.000000,0.000000,0.000000]), #($Editable_Mesh:VRayProxy003 @ [0.000000,0.000000,0.000000], $Editable_Mesh:VRayProxy003 @ [0.000000,0.000000,0.000000], $Editable_Mesh:VRayProxy003 @ [0.000000,0.000000,0.000000]), #($Editable_Mesh:VRayProxy001 @ [0.000000,0.000000,0.000000], $Editable_Mesh:VRayProxy001 @ [0.000000,0.000000,0.000000], $Editable_Mesh:VRayProxy001 @ [0.000000,0.000000,0.000000]))
#()
"1"
"selected obj: "
$VRayProxy:VRayProxy002 @ [105.451233,63.242535,-15.809784]
"newMesh: "
$Editable_Mesh:VRayProxy002 @ [0.000000,0.000000,0.000000]
$Editable_Mesh:VRayProxy002 @ [0.000000,0.000000,0.000000]
$Editable_Mesh:VRayProxy002 @ [0.000000,0.000000,0.000000]
"2"
"selected obj: "
$VRayProxy:VRayProxy003 @ [105.451233,148.749832,-15.809784]
"newMesh: "
$Editable_Mesh:VRayProxy003 @ [0.000000,0.000000,0.000000]
$Editable_Mesh:VRayProxy003 @ [0.000000,0.000000,0.000000]
$Editable_Mesh:VRayProxy003 @ [0.000000,0.000000,0.000000]
"3"
"selected obj: "
$VRayProxy:VRayProxy001 @ [121.075500,-3.243168,-15.809784]
"newMesh: "
$Editable_Mesh:VRayProxy001 @ [0.000000,0.000000,0.000000]
$Editable_Mesh:VRayProxy001 @ [0.000000,0.000000,0.000000]
$Editable_Mesh:VRayProxy001 @ [0.000000,0.000000,0.000000]
OK
"-----"
"-----"
#(#($Editable_Mesh:VRayProxy002 @ [0.000000,0.000000,0.000000], $Editable_Mesh:VRayProxy002 @ [0.000000,0.000000,0.000000], $Editable_Mesh:VRayProxy002 @ [0.000000,0.000000,0.000000]), #($Editable_Mesh:VRayProxy003 @ [0.000000,0.000000,0.000000], $Editable_Mesh:VRayProxy003 @ [0.000000,0.000000,0.000000], $Editable_Mesh:VRayProxy003 @ [0.000000,0.000000,0.000000]), #($Editable_Mesh:VRayProxy001 @ [0.000000,0.000000,0.000000], $Editable_Mesh:VRayProxy001 @ [0.000000,0.000000,0.000000], $Editable_Mesh:VRayProxy001 @ [0.000000,0.000000,0.000000]))
Can someone help me out with this? I don't understand why the selection.count influences the number of importation of a vrayproxy. I don't know if it's a issue or not?
Thank you
Comment