help me
hello, im trying to asign 1 material to multiply objects as follows:
s1 = [255, 255, 255]
for i = 1 to 100 do
(
Foliage name:"abc" Height:a Density:1 Pruning:b pos:[(i*70)+xpos,ypos,zpos] isSelected:on
VNmat = StandardMaterial \
name:"VNmat" \
diffuse 1
$abc.material = VNmat
)
and creates 100 objects, but the problem is only the first 2 objects gets the material collor i assign at s1, the later ones gets some random collor which i have no idea where it comes from.
so i would like to ask if someone know whats the problem in here, i hope i made my self clear, if not please ask me for details.
dont mind the xpos,ypos,zpos, they are some user spesific numbers.
s1 = [255, 255, 255]
for i = 1 to 100 do
(
Foliage name:"abc" Height:a Density:1 Pruning:b pos:[(i*70)+xpos,ypos,zpos] isSelected:on
VNmat = StandardMaterial \
name:"VNmat" \
diffuse 1
$abc.material = VNmat
)
and creates 100 objects, but the problem is only the first 2 objects gets the material collor i assign at s1, the later ones gets some random collor which i have no idea where it comes from.
so i would like to ask if someone know whats the problem in here, i hope i made my self clear, if not please ask me for details.
dont mind the xpos,ypos,zpos, they are some user spesific numbers.
0 Taškai
man reikia nupiesti kelis vienodus medzius, juos nupiesia, bet deda skirtingas spalvas, pirmi du medziai gerai su spalvom o kitiem jau deda randomu.
0 Taškai
Пожалуиста подаи свои вопрос на китаиском языке, потому что мне трудновато с англиским. Спасибо!
--
Viską žinau - nieko nemoku.
0 Taškai
Nu žmogus parašė kodą, kad darytų objektus, pirmi du nusispalvina nurodyta spalva, visi kiti ne, tame ir problema. Čia, kad padėt reikia su scriptu dirbt.
0 Taškai
Turbūt problema ne čia, bet pabandyk iškelti šiais eilutes virš ciklo:
VNmat = StandardMaterial \
name:"VNmat" \
diffuse 1
nežinau visų ten subtilybių, bet kam kiekvieną kartą kurti tokį patį materialą, jei galima vienakart susikurti, ir paskui tik priskirti jį.
VNmat = StandardMaterial \
name:"VNmat" \
diffuse 1
nežinau visų ten subtilybių, bet kam kiekvieną kartą kurti tokį patį materialą, jei galima vienakart susikurti, ir paskui tik priskirti jį.
0 Taškai
Translation:
Probably roots of the problem are not here, but try moving these lines above cycle:
VNmat = StandardMaterial \
name:"VNmat" \
diffuse 1
There is no need to create new material every time, you can just create it once and then apply to objects.
Probably roots of the problem are not here, but try moving these lines above cycle:
VNmat = StandardMaterial \
name:"VNmat" \
diffuse 1
There is no need to create new material every time, you can just create it once and then apply to objects.
0 Taškai
-- Define global material
VNmat = StandardMaterial name:"VNmat" diffuse 1
-- Array to store all objects in
myFoliageArray = #()
for i = 1 to 100 do
(
-- Create tree
tree = Foliage name: ("abc" + i as String) Height: a Density:1 Pruning:b pos:[(i*70)+xpos,ypos,zpos]
-- Assign material to a tree
tree.material = VNmat
-- Append tree to an array
append myFoliageArray tree
)
VNmat = StandardMaterial name:"VNmat" diffuse 1
-- Array to store all objects in
myFoliageArray = #()
for i = 1 to 100 do
(
-- Create tree
tree = Foliage name: ("abc" + i as String) Height: a Density:1 Pruning:b pos:[(i*70)+xpos,ypos,zpos]
-- Assign material to a tree
tree.material = VNmat
-- Append tree to an array
append myFoliageArray tree
)
--
fighting the good fight
0 Taškai
Arba paprasciau butu taip.
Iskelk
VNmat = StandardMaterial name:"VNmat" diffuse 1
$abc.material = VNmat
is ciklo ir pakeisk
$abc.material = VNmat
i
$abc*.material = VNmat
Iskelk
VNmat = StandardMaterial name:"VNmat" diffuse 1
$abc.material = VNmat
is ciklo ir pakeisk
$abc.material = VNmat
i
$abc*.material = VNmat
--
fighting the good fight
0 Taškai
aciu uz pagalba ir manau man jos dar reikes, nes mano bakalauro tema 3ds max programoje sukurti skriptą, kuris pagal užduotus parametrus generuoja trimačius skirtingų rušių medžių modelius. O esme ta kad musu apie tai niekas nemokino , ir darbo vadove apie tai pati neismano.
0 Taškai
O kodėl anglishkai klausi, aš čia kaip durna verčiu
:blink:
:blink:
0 Taškai
Jolcka:
1. Parasyk, ka reik suscriptinti.
2. Nupirk deze alaus
🙂
1. Parasyk, ka reik suscriptinti.
2. Nupirk deze alaus
🙂
--
fighting the good fight
0 Taškai
😀 gerai cia alvius...man irgi kada apsisarvojus ilgu pagaliu reiktu pajudint scripta bet taip baisu...
0 Taškai
Jums reikės prisijungti, jei norite rašyti atsakymą.