|
POST
|
aah, somebody did not look at the manual first .. 🙂 just change the Exporter's Granularity setting from "Use file size limit" to "Create one file per shape".
... View more
08-22-2012
08:51 AM
|
0
|
0
|
3270
|
|
POST
|
hi ! I'd also try to go over the UUID. just strip off the :x at the end. did not try this though. what I've seen is that in the Navigator, the Information tab is missing for graph segments, that's a bug. I've forwarded it.
... View more
08-21-2012
07:52 AM
|
0
|
0
|
687
|
|
POST
|
try the OID / UUID the end of it usually shows :0, :1, :2. though I'm not perfectly sure if this is always consistent. [ btw. same with Block and it's children ]
... View more
08-21-2012
07:34 AM
|
0
|
0
|
1081
|
|
POST
|
got it. as assumed. was a missing i += 1 here's the new file !
... View more
08-21-2012
07:24 AM
|
1
|
0
|
939
|
|
POST
|
other inputs : - use fileRandom() - use modulo function ( 5 % 2 = 1 ) with a recursion index - if you cannot have overlapping instances, choose a split(x){{split(z)}* }*, then a p() to place stuff on those tiles - if you cannot have overlapping instances, you could also do a recursive split(x){alignScopeToGeometry "longest edge"} until your shards are small enough ( escape case : case scope.sx < minSize ) ( = strategies from here : http://forums.arcgis.com/threads/54152-Distributing-assets-on-a-surface ) in general, it depends a little on what you're distributing. if it's stull like bullet holes or rubble, I'd also use scatter(). maybe check the code in the DownTown Damage example too for inspiration. 🙂 if you place stuff 'along a road', I'd rather use my original input plus a certain delta value to distribute 'to the sides'. lemme know if you need other inputs.
... View more
08-21-2012
07:10 AM
|
0
|
0
|
1830
|
|
POST
|
hmm. I did not test it that thoroughly. but I assume there's a little issue with the indices in the loop which grabs the corresponding coordinates. I guess I'd be faster debugging this than you, so I'll try to find the issue. sry for that .. I'm not a developer .. 🙂
... View more
08-21-2012
12:36 AM
|
0
|
0
|
2438
|
|
POST
|
cool ! show us some pictures once your done .. or even WIP ! 🙂
... View more
08-20-2012
12:59 AM
|
0
|
0
|
2957
|
|
POST
|
hi ! the default color is just white color(1,1,1) // or legacy : color("#ffffff") to find the default material attributes, just try to print those you're interested in. resetting just means setting the value back to the first value.
... View more
08-20-2012
12:54 AM
|
0
|
0
|
1129
|
|
POST
|
edit the code around line 240 : 1] note the MakeLaneMarkers shape copy after the Vehicles(). 2] add the code for the marker creation and position reports Streetsides --> case calcNbrOfLanes < 1.1 : Asphalt case Nbr_of_left_lanes == 0 && Nbr_of_right_lanes == 0: split(v,unitSpace,0){ ~calcLanesLeft : Lanes(calcNbrOfLanes,connectionEnd,0) Vehicles(0) MarkerCreation("left") | Median_width : Median | ~calcLanesRight : scaleUV(0,-1,-1) Lanes(calcNbrOfLanes,connectionStart,2) Vehicles(2) MarkerCreation("right") } else: split(v,unitSpace,0){ ~Nbr_of_left_lanes : Lanes(Nbr_of_left_lanes,connectionEnd,0) Vehicles(0) MarkerCreation("left") | Median_width : Median | ~Nbr_of_right_lanes : scaleUV(0,-1,-1) Lanes(Nbr_of_right_lanes,connectionStart,2) Vehicles(2) MarkerCreation("right")} @Range ( "all", "left", "right") @Group("MARKERS") attr markerOutput = "all" MarkerCreation(side) --> case markerOutput == "all" : MakeLaneMarkers case markerOutput == side : MakeLaneMarkers else : NIL MakeLaneMarkers --> color(1,0,0) t (0,.1,0) split(v,unitSpace,0) { ~Lane_width : LaneShape }* LaneShape --> split(v,unitSpace,0) { ~1 : NIL | markerDim : LaneCenterLine | ~1 : NIL } markerDim = 0.25 markerDist = 15 LaneCenterLine --> split(u,unitSpace,0) {{ markerDim : LaneMarker | ~ markerDist : NIL }* | markerDim : LaneMarker } LaneMarker --> report("markerPosX", convert(x, scope, world, pos, 0.5 * scope.sx, 0.5 * scope.sy, 0.5 * scope.sz)) report("markerPosY", convert(y, scope, world, pos, 0.5 * scope.sx, 0.5 * scope.sy, 0.5 * scope.sz)) report("markerPosZ", convert(z, scope, world, pos, 0.5 * scope.sx, 0.5 * scope.sy, 0.5 * scope.sz)) X. # NIL Now once you generate a street, you should get the reports in the Inspector's Reports tab. To grab those and produce your java script code : 1] copy the attached .py script to your scripts folder 2] run the Script Based Exporter ( Python ), where you select the new script under the Misc options, then run it. 3] open the console ( Python output ) and get your code. To adapt the offset, just copy paste your export offset values and edit the Python script accordingly. I also just added the lane direction switch called (markerOutput). Note also that now, the markers are produced as geometry, thus you may want to NIL it as commented out in the last line after the reports ( X. # NIL ) let me know if it works on your machine too. 😉
... View more
08-20-2012
12:38 AM
|
0
|
0
|
6463
|
|
POST
|
hi ! it uses a distance attribute, thus places markers approximately that distance apart from each other. this example just produced 4. I'll wrap up the code and post here.
... View more
08-20-2012
12:19 AM
|
0
|
0
|
2438
|
|
POST
|
so that'd be the result of what CE produces for the markers : 1 street segment with 3 lanes, 4 marker points per lane ( 12 in total ) instantiateMarker ( 820207.073822,9.48134291172,-72516.0204315,0);
instantiateMarker ( 820207.073822,9.48134291172,-72516.0204315,1);
instantiateMarker ( 820207.073822,9.48134291172,-72516.0204315,2);
instantiateMarker ( 820207.073822,9.48134291172,-72516.0204315,3);
instantiateMarker ( 820207.073822,9.48134291172,-72516.0204315,4);
instantiateMarker ( 820207.073822,9.48134291172,-72516.0204315,5);
instantiateMarker ( 820207.073822,9.48134291172,-72516.0204315,6);
instantiateMarker ( 820207.073822,9.48134291172,-72516.0204315,7);
instantiateMarker ( 820207.073822,9.48134291172,-72516.0204315,8);
instantiateMarker ( 820207.073822,9.48134291172,-72516.0204315,9);
instantiateMarker ( 820207.073822,9.48134291172,-72516.0204315,10);
instantiateMarker ( 820207.073822,9.48134291172,-72516.0204315,11); now I assume you run your general CE exports with the offset correction to center the dataset around the cartesian origin in Unity. Once you know that XZ offset, this could be subtracted from the results which you get by the reports. of course you could run this twice, once just for the right lanes, once just for the left lanes. 🙂 let me know what you think so far.
... View more
08-17-2012
08:58 AM
|
0
|
0
|
2438
|
|
POST
|
ah, sorry, yes. With Python, I can directly create the JavaScript code ( basically just a text output ) which creates the code you quoted, looping over all markers CE finds. when you can post 1 example that runs with the correct syntax ( e.g. vector definition ), I can make the code generic and directly feed the positions.
... View more
08-17-2012
07:02 AM
|
0
|
0
|
2438
|
|
POST
|
1] Placing assets on a street is done easily like that : Since street shapes have nicely layouted UVs already, use UV-splits to split them along the length and across. Since CGA always must have geometry to work on, the best thing for placement is to cut a thin stripe (give it some room to work on, don't go below 1 cm) on which the assets are supposed to be placed.
markerDim = 0.03
Street --> # or Lane
split(v,unitSpace,0) { ~1 : NIL | markerDim : Stripe | ~1 : NIL }
Then split this stripe again along it's length, e.g. :
markerDist = 15
Stripe -->
split(u,unitSpace,0) {{ ~ markerDist : NIL | markerDim : AssetPosition. | }* | ~ markerDist : NIL}
Of course, you want to place the assets in certain distances, so you could come up with a rule ( even recursive ) which uses 'geometry.du' or 'geometry.dv' ( arclength, check docs ). Let me know if there's questions. 2] Concerning asset rotation along the curvature, get back to me. That's done fast. matt
... View more
08-17-2012
01:21 AM
|
0
|
0
|
1830
|
|
POST
|
there's only 1 way to do such a thing, but not directly with a tool. I'll explain later. is that split line predefined or how would you define it ?
... View more
08-17-2012
01:04 AM
|
0
|
0
|
994
|
|
POST
|
cool so far then. I guess we're faster if I quickly write the code down, then pass the stuff on for refinement. can you find me a line of code which creates such a marker via code ? pseudo code : putStreetMarker(x,y,z) then I could create directly the text you can run which produces all markers for you. let me know ..
... View more
08-17-2012
01:01 AM
|
0
|
0
|
4025
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-06-2012 08:40 AM | |
| 1 | 09-30-2013 08:33 AM | |
| 1 | 08-07-2013 04:45 AM | |
| 1 | 10-15-2012 02:19 AM | |
| 1 | 01-30-2014 12:09 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|