Hi,
I have a problem with my cga rule.I changed the location of the file,then i imported the file to CE again.But textures are lost.Only 2 of texture image are shown as facade image.In fact,there are about 150 texture image.What can be the reason?...
Additionally,assume that i changed something in cga file,but i did not save it.Although i did not save it ,the cga file is keeping all of the changes.The other problem is that when i use a cga file in 2 different projects and make some changes in cga file in of one of these projects,the cga file which was used in other project also changes.This is so absurd:) Do you have an idea about that?...
Thanks 🙂
#####################################################################
My rule is:
@Hidden
attr binayukseklikhesabi=MEAN_Z
attr MEAN_Z = rand (0,200)
@Hidden
attr Roof_Ht = 1.5
@Group("Cephe Giydirme",2) @Order(1) @Description("If true, random textures are shown for facades")
attr Doku_Goster = true
@Group("Cephe Giydirme") @Order(2) @Range(2.9,5.2) @Description("in Meters")
attr Kat_Yuks = 3
@Group("Cephe Giydirme") @Order(3)
attr Facade_Image = fileRandom("asset/Cepheler/Cep_*_Kat"+texFloors+"_*.jpeg") # potential texture which is high enough (see below)
const texFloors =
case nFloors == 1 : 1
case nFloors == 2 : 2
case nFloors == 3 : 3
case nFloors == 4 : 4
case nFloors == 5 : 5
case nFloors == 6 : 6
case nFloors == 7 : 7
case nFloors == 8 : 8
case nFloors == 9 : 9
else : 10
# after a texture with a compatible floor number has been randomly selected, the
# filename is parsed to get information how many tiles are in this image:
const texTiles = float(getRange(Facade_Image,"Pen",".jpeg")) # truncate the file name to get actual number of tiles
# for facade texturing (operating on the *current* geometry)
nFloors = rint(scope.sy/Kat_Yuks)
nTiles = ceil(scope.sx/Kat_Yuks*0.75)
# needed to setup the texture projection to the current facade so that the texture fits
getFacadeTexProjectionHeight = scope.sy/nFloors*texFloors
getFacadeTexProjectionWidth = scope.sx/nTiles*texTiles
Lot-->
alignScopeToAxes(y) s('1,0,'1) # make it horizontal i.e. scale it flat
extrude(binayukseklikhesabi)
comp(f){side : Facade | top : Roof }
# Facade Generation
#
attr OBJECTID = 2
Facade -->
set(seedian,OBJECTID*30)
Facade(getFacadeTexProjectionWidth,getFacadeTexProjectionHeight,0,0)
Facade(w,h,offsetW, offsetH)-->
case Doku_Goster == true :
setupProjection(0,scope.xy,w,h,offsetW,offsetH) projectUV(0)
texture(Facade_Image)
else:
Facade
# Roof#########################################
#
const myRoofTexture = fileRandom("assets/Cati/*.jpg")
@Group ("Roof") @Range ("Tip1","Tip2","Tip3","Tip4","Tip5")
attr CatiTipi = "Tip1"
Roof -->
case CatiTipi == "Tip1" :
roofHip (30,0.5)
comp(f) { all: CatiDuzlemleri }
case CatiTipi == "Tip2" :
roofShed(15)
comp(f) { all: CatiDuzlemleri }
case CatiTipi == "Tip3" :
roofGable(45,0,0,false,0)
comp(f) { all: CatiDuzlemleri }
case CatiTipi == "Tip4" :
roofPyramid(45)
comp(f) { all: CatiDuzlemleri }
else: CatiDuzlemleri
CatiDuzlemleri -->
setupProjection(0, scope.xy, 8,8) projectUV(0)
scaleUV(0,2,2)
texture("asset/Cepheler/kiremit.jpg")