diff --git a/260424-GrayScale.toe b/260424-GrayScale.toe index c299686..30638f8 100644 Binary files a/260424-GrayScale.toe and b/260424-GrayScale.toe differ diff --git a/camera_position.py b/camera_position.py index 0c4758d..5eb375d 100644 --- a/camera_position.py +++ b/camera_position.py @@ -1,70 +1,112 @@ """ + Script DAT Callbacks + me - this DAT + scriptOp - the OP which is cooking + """ + import math + def onCook(scriptOp): + """ Called when the Script DAT needs to cook. + """ + scriptOp.clear() scriptOp.appendRow(['id', 'P(X)', 'P(Y)', 'P(Z)', 'Rot(x)', 'Rot(y)', 'Rot(z)']) + + # 1. Fetch Constants const_op = op('constant_camera') camera_y_offset = 0 camera_y_far = 0 + + # Default rotation and timing values rx, ry, rz = 0.0, 0.0, 0.0 duration_per_step = 3.0 + + if const_op: + # Distance Offsets target_chan = const_op.chan('camera_distance_y') if target_chan is not None: camera_y_offset = target_chan.eval() + + far_chan = const_op.chan('camera_distance_y_far') if far_chan is not None: camera_y_far = far_chan.eval() + + # Rotation Values + rx_chan = const_op.chan('rot_x') ry_chan = const_op.chan('rot_y') rz_chan = const_op.chan('rot_z') + if rx_chan is not None: rx = rx_chan.eval() if ry_chan is not None: ry = ry_chan.eval() if rz_chan is not None: rz = rz_chan.eval() + + # Duration / Speed + dur_chan = const_op.chan('duration_per_seconds') if dur_chan is not None: duration_per_step = max(0.1, dur_chan.eval()) # Prevent division by zero + + # 2. Check for specific ID selection + const_select = op('SelectId') select_id = -1 + if const_select: select_chan = const_select.chan('id') if select_chan is not None: select_id = int(select_chan.eval()) + + # 3. Input Validation + if len(scriptOp.inputs) == 0: return + + inputDat = scriptOp.inputs[0] + + # CASE A: Tracking a specific single ID + if select_id >= 0: # Ensure the target CHOP exists target_path = 'grid_text' + str(select_id + 1) + '/OUT' out = op(target_path) + rx=0 + ry=0 + rz=0 + + if out: try: px_val = out['px'].eval() @@ -80,7 +122,7 @@ def onCook(scriptOp): else: raw_points = [] sum_x, sum_y, sum_z = 0.0, 0.0, 0.0 - + # Gather up to 4 points from the input table for i in range(1, min(5, inputDat.numRows)): try: @@ -88,15 +130,21 @@ def onCook(scriptOp): py = float(inputDat[i, 2] or 0) pz = float(inputDat[i, 3] or 0) raw_points.append((px, py, pz)) + sum_x += px sum_y += py sum_z += pz + except (ValueError, TypeError): continue + + if not raw_points: return + + # Calculate Average Position num_raw = len(raw_points) avg_pos = (sum_x / num_raw, sum_y / num_raw, sum_z / num_raw) @@ -116,10 +164,8 @@ def onCook(scriptOp): idx1 = int(progress) idx2 = (idx1 + 1) % num_steps alpha = progress - idx1 - # Smooth transition (Cosine ease) alpha = (1 - math.cos(alpha * math.pi)) / 2 - # Perform Linear Interpolation p1 = sequence[idx1] p2 = sequence[idx2] @@ -127,11 +173,12 @@ def onCook(scriptOp): ax = p1[0] + (p2[0] - p1[0]) * alpha ay = p1[1] + (p2[1] - p1[1]) * alpha az = p1[2] + (p2[2] - p1[2]) * alpha - label = "avg" if (idx2 == 0) else str(idx2) scriptOp.appendRow([label, ax, ay, az - camera_y_far, rx, ry, rz]) - return + + def onGetCookLevel(scriptOp): - return CookLevel.AUTOMATIC \ No newline at end of file + return CookLevel.AUTOMATIC + diff --git a/dat_table_json__td_7768_7.tsv b/dat_table_json__td_7768_7.tsv index 3c34200..d637c8b 100644 --- a/dat_table_json__td_7768_7.tsv +++ b/dat_table_json__td_7768_7.tsv @@ -1,51 +1,51 @@ text group center_x center_y center_z axis_x axis_y axis_z radius info -如果隔壁現在開一倍 0 0 -0.455708811472717 0 0 1 0 3.8657247172243965 //2024/09/16 13:10/1 likes - 0 0 -1.8900155931575178 0 0 1 0 1.9023628695046 /undefined likes/undefined replies -我買170 0 0 -0.23358353776171814 0 0 1 0 4.022297634809797 //2024/09/16 13:03/1 replies -你家超美欸!! 0 0 -0.4136266842782961 0 0 1 0 5.332145932715964 //2024/09/17 00:42/1 replies -適合自己只有自己最知道! 0 0 -1.5896606582391373 0 0 1 0 1.6506509752136578 //2025/12/25 16:17/1 likes/1 replies -好多建設蓋起來了 0 0 -0.2660554324234905 0 0 1 0 4.346106858234708 //2024/09/16 01:37/8,076 likes/482 replies -我要找發財的房子 0 0 -3.594279403962245 0 0 1 0 4.080053003902635 //2026/01/01 20:51/1 likes -悲慘房奴 2 0 -0.6830561638135739 0 0 1 0 2.908978801783894 //2025/12/07 18:05 -每月房租1.8 2 0 -0.48447139968840247 0 0 1 0 3.516247126811615 //2025/04/07 22:20/1 likes -商家老闆再次 請慢用 2 0 -0.7003731781487827 0 0 1 0 1.8874219767044604 //2024/09/16 20:57/1 likes -請慢用~ 2 0 -0.21604964250614334 0 0 1 0 1.9404473325638902 //2024/09/16 15:46/1 likes -你家好漂亮欸😍 2 0 -0.6056955692947286 0 0 1 0 2.608007353824966 //2024/09/17 00:22/1 replies -獨立隔間 單人房 2 0 -1.304626202490688 0 0 1 0 3.32350465606919 //2025/12/30 02:19 -我貸款也要去租 2 0 -3.295196852101169 0 0 1 0 3.985429169224767 //2026/01/01 03:42/1 likes -當下住進去的時候 2 0 0.35475322470322723 0 0 1 0 2.2473713788844587 //2024/09/16 21:11 -付房租費 2 0 -0.8226459198390215 0 0 1 0 3.7283769498368344 //2025/04/07 23:03 -沒有地方好住 3 0 0.26362316440332734 0 0 1 0 1.1531349678488905 //2025/04/09 00:21/1 replies -為什麼竹科工程師是在板橋 3 0 -0.05907426619493883 0 0 1 0 0.9157159611842615 /undefined likes/undefined replies -你們家很漂亮欸 3 0 0.7485137126363446 0 0 1 0 5.7033763659814944 //2024/09/16 22:32/1 likes/1 replies -超值! 3 0 1.0339952484865522 0 0 1 0 4.730731670502431 //2024/09/16 15:07/2 likes/1 replies -房東壓力,不敢申請補助 3 0 0.6297676707502902 0 0 1 0 1.5949491148722628 //2025/12/27 19:55/291 likes/395 replies -沒有房租還有車有房 3 0 0.7373485456162294 0 0 1 0 1.3340737049006643 //2024/07/02 13:45 -八萬要租房 1 0 2.8369656274458386 0 0 1 0 3.08715213361605 //2025/08/03 19:25/1 likes -業配。 3 0 0.43206321806137726 0 0 1 0 5.159423554074238 //2024/09/16 20:55/1 replies -你哪來的學貸? 1 0 2.7338777491464876 0 0 1 0 3.353975170649582 //2025/12/28 02:13/5,416 likes/18 replies -住家裡存錢更多 1 0 2.640052443765976 0 0 1 0 3.057392764627019 //2025/08/04 00:49/28 likes -買的當下壓力好大 1 0 3.2311445731956114 0 0 1 0 5.001720618654962 //2024/09/16 18:07/1 replies -無房無車住家裡 0 0 -1.5207728864974719 0 0 1 0 1.838586297197233 //2025/03/14 16:49/1 likes -不一定付房貸車貸 0 0 -0.4074492639063214 0 0 1 0 1.5823112932219185 //2025/08/03 21:09/1 likes -在家享受房租 1 0 2.1180959211631647 0 0 1 0 2.8121724982017593 //2025/12/07 20:01/1 likes/1 replies -請慢用~ 0 0 -0.566269413622372 0 0 1 0 4.280248494734203 //2024/09/16 13:33/1 likes/1 replies -你哪來的學貸? 1 0 2.565698342461989 0 0 1 0 3.127826081826676 //2025/12/28 02:13/5,416 likes/18 replies -來玩ㄇ 3 0 0.29857174307511336 0 0 1 0 4.760712684896848 //2024/09/16 20:57 -大家看不懂 2 0 -0.10204827960964735 0 0 1 0 0.38400873167402655 //2025/08/04 00:26/6 likes/1 replies -做好自己,幸運就不會浪費 3 0 0.2204606724025524 0 0 1 0 0.47753799390172685 /undefined likes/undefined replies -得了便宜還賣乖 3 0 0.0894973608587879 0 0 1 0 0.6042400977966168 /undefined likes/undefined replies -房子在那? 1 0 -0.6506306244718321 0 0 1 0 0.768048784512705 //2026/01/01 13:33 -享受房租中 1 0 1.950685831872459 0 0 1 0 2.9894858950645995 //2025/12/07 23:12 -我更可憐吧 1 0 2.566268524969468 0 0 1 0 3.1083408057240494 /undefined likes/undefined replies -你自己賺錢換回來 3 0 -0.5106186313719681 0 0 1 0 0.7129387860071758 //2025/07/16 09:25 -有些自由,真的不便宜。 3 0 -0.16452905144356045 0 0 1 0 1.2645752511188597 //2025/04/07 08:30/2.0 萬 likes/150 replies -我要去租🤣🤣🤣 1 0 -0.36354829603130767 0 0 1 0 0.5356707876291918 //2026/01/01 16:35 -需要去 c 一下🤭 1 0 -0.5579395116704386 0 0 1 0 0.6136575908805135 //2026/01/01 21:33 - 1 0 1.4499210811067442 0 0 1 0 2.5051156916393866 //2025/10/04 19:02/1 likes/1 replies -大大的家好美❤️ 0 0 -0.18920620266299348 0 0 1 0 5.0050404558203985 //2024/09/16 19:11/1 likes/1 replies -你家超漂亮!!!! 1 0 2.774429722748586 0 0 1 0 4.882656817212039 //2024/09/16 11:24/2 likes/1 replies -看得我也想租😲 1 0 -0.223296313676963 0 0 1 0 0.5200583776951658 //2026/01/01 20:15 -有旺運財運的房屋 1 0 -0.40050864689247234 0 0 1 0 0.7541553201236338 //2026/01/01 13:39/1 likes -好美的家 3 0 0.5583743932329259 0 0 1 0 5.53071476912797 //2024/09/16 12:06/1 likes/1 replies -我想租 1 0 -0.3370632148590218 0 0 1 0 0.41522238280621643 //2026/01/01 15:56 +適合自己只有自己最知道! 0 0 -1.003461371629193 0 0 1 0 1.0096787055104293 //2025/12/25 16:17/1 likes/1 replies +卡一個 0 0 -2.284370315246562 0 0 1 0 2.86825202203251 //2026/01/01 04:31 +我想租 0 0 -3.197610830419242 0 0 1 0 3.3149398994323565 //2026/01/01 15:56 +好想住這間 0 0 -3.580431830792726 0 0 1 0 3.9747817173257354 //2026/01/01 09:29 +需要去 c 一下🤭 0 0 -4.299929932686094 0 0 1 0 4.555576296855112 //2026/01/01 21:33 +看得我也想租😲 0 0 -3.1830287030164754 0 0 1 0 3.534257336040928 //2026/01/01 20:15 +做好自己,幸運就不會浪費 0 0 0.8057938437143051 0 0 1 0 0.9066077119680405 /undefined likes/undefined replies +有自己的房子就是雙!!!! 0 0 -0.7571004170308484 0 0 1 0 0.9838098198343564 //2025/10/05 20:27/1 likes + 1 0 -1.9862688069858088 0 0 1 0 2.048626604509808 /undefined likes/undefined replies +我要找發財的房子 1 0 -3.908460558572317 0 0 1 0 3.964647147945867 //2026/01/01 20:51/1 likes +租 1 0 -3.401361260998753 0 0 1 0 3.9785337013984683 //2026/01/01 04:14/2 likes +房子在那? 1 0 -4.65198648639617 0 0 1 0 4.92976893358628 //2026/01/01 13:33 +我要去租🤣🤣🤣 1 0 -4.375100675309097 0 0 1 0 4.685789453038093 //2026/01/01 16:35 +卡 1 0 -2.647440879191617 0 0 1 0 3.502390985626181 //2026/01/01 01:22 +我自己想做的 1 0 -0.21240543574593573 0 0 1 0 0.6836895147685885 //2025/09/12 08:22/1 likes +卡 1 0 -3.08231211083673 0 0 1 0 3.9383226061742116 //2026/01/01 00:21/1 likes +在哪裡我要住 3 0 -0.26332254807898714 0 0 1 0 0.8555992911868763 //2026/01/01 02:33 +我貸款也要去租 3 0 -0.45421712767121925 0 0 1 0 0.5976366417812061 //2026/01/01 03:42/1 likes +卡 2 0 -3.516590700136904 0 0 1 0 4.149677854101578 //2026/01/01 20:19 +我信 房屋玄學+1 3 0 0.8652174515623994 0 0 1 0 1.5498172465001891 //2026/01/01 14:39 +那麼好 3 0 0.001818722080530577 0 0 1 0 2.014089570677993 //2026/01/01 20:07/2 likes +我也想住😃 3 0 0.6145075512688312 0 0 1 0 0.799424310724246 //2026/01/01 21:31 +公司幫妳付房貸 2 0 -5.1459593154937835 0 0 1 0 5.202350660086868 /undefined likes/undefined replies +房子不大,我也小巧。剛剛好 2 0 -1.7990829969283055 0 0 1 0 1.9065677896799482 //2025/10/05 14:29/1 likes +不用比較 2 0 -0.3609484543086747 0 0 1 0 0.4843245615958131 /undefined likes/undefined replies +附上網頁連結 1 0 -0.06800579127808781 0 0 1 0 0.6492119106352497 //2025/09/12 08:19/2 likes +開介紹卡之前 0 0 0.1481521082157613 0 0 1 0 0.5151039047330417 //2025/09/12 08:19/1 likes/1 replies +專注打造 不必辯解 2 0 -0.16568718384605852 0 0 1 0 0.2978570307530427 /undefined likes/undefined replies +推,總結得很好 2 0 -0.5021933525107443 0 0 1 0 0.5579225061983906 /undefined likes/undefined replies +規則自己訂,好玩就好! 0 0 -0.3987396088019679 0 0 1 0 0.4029335991597087 /undefined likes/undefined replies +是個好房子耶~ 3 0 -0.2173185451727928 0 0 1 0 1.5726606171649953 //2026/01/01 18:02 +房子真的會挑人 3 0 0.9517817114389473 0 0 1 0 1.5287265849476614 //2026/01/01 11:46/1 likes +我欸 2 0 -2.3544549650116036 0 0 1 0 2.4642617295762017 //2025/12/07 19:19 +想住🤩 3 0 0.3621820313829165 0 0 1 0 0.8634110950117735 //2026/01/01 14:12 +感覺很讚的房子🏠 3 0 -0.043780019441291174 0 0 1 0 1.5420796274560624 //2026/01/01 04:42 +我只想買房😙😙😙不用婚 3 0 0.9551708525534419 0 0 1 0 1.805598631728413 //2025/12/31 23:33 +你哪來的學貸? 3 0 2.169151387039159 0 0 1 0 2.5565064194455878 //2025/12/28 02:13/5,416 likes/18 replies +不知道房子還在嗎🤣 3 0 -0.6376434257843879 0 0 1 0 1.0317969140142504 //2026/01/01 12:41 +博主推薦 1 0 -0.030020134462468206 0 0 1 0 0.42529543136476966 //2025/08/18 20:42/6 likes +我買170 3 0 -0.1383297881469847 0 0 1 0 0.8146667115704005 //2024/09/16 13:03/1 replies +好的房子也得配上本身的福報 3 0 0.1260624463704918 0 0 1 0 1.704008502583054 //2026/01/01 15:40 +頭期款我付的 3 0 0.9781803324644187 0 0 1 0 1.580983985011773 /undefined likes/undefined replies +有旺運財運的房屋 3 0 0.39928283463092384 0 0 1 0 1.3895250151416767 //2026/01/01 13:39/1 likes +自求自悟自奮鬥 2 0 -3.7335473089833346 0 0 1 0 3.9500828205336864 //2025/12/31 23:42 +這個地點我可以 3 0 0.5550450492859245 0 0 1 0 1.4957080012637711 //2025/12/31 23:30/1 likes/1 replies +正在做一樣的事情 2 0 -2.3525254963424604 0 0 1 0 2.5717616045905447 //2025/12/07 21:44 +最近也考慮買一間 2 0 -5.355535811575201 0 0 1 0 5.405508201848776 /undefined likes/undefined replies +房屋也會找人 3 0 0.8160529052597418 0 0 1 0 1.3076022297808974 //2026/01/01 21:33/1 likes +這間房子在哪裡呢 3 0 -0.179120851022196 0 0 1 0 0.897526529550288 //2026/01/01 08:30 +每天享受自己的房貸🤣 3 0 2.0850411111308507 0 0 1 0 2.7489574927460123 //2025/12/09 07:59 diff --git a/dat_table_keyword__td_7768_6.tsv b/dat_table_keyword__td_7768_6.tsv index 0accd0e..aeb9bc3 100644 --- a/dat_table_keyword__td_7768_6.tsv +++ b/dat_table_keyword__td_7768_6.tsv @@ -1,5 +1,5 @@ id text tx ty tz group dist question -1 窮忙 0.42948128834779487 -4.448928999433766 -5.539009809941537 0 0.7019542320848058 你今天的行程裡,有多少比例是為了自己? -4 租屋 -1.045980281922074 -7.869809910666323 -4.245497410767069 1 0.6950491059419176 這個月薪水的幾分之幾交給房東了? -10 邊界 0.07964552308406607 -4.743649682683703 -2.9649364503358275 2 0.4912924718032982 你什麼時候會說不,來保護自己? -16 做自己 -0.7864300146231561 -5.5847825447264405 -5.862022263863594 3 0.6285578689298785 在公共場所,你覺得自己有多少程度能呈現真實的樣貌? +4 租屋 10.702299650770042 -13.08590835720286 -3.5680651069022895 0 0.4086285372757818 這個月薪水的幾分之幾交給房東了? +8 潛規則 10.097835697878713 -9.473117961574157 -4.38679744495951 1 0.5334495609082873 有哪些規則是沒被寫出來,但你卻正在默默遵守的? +15 主體 9.640705005801319 -9.0157785847078 -4.300070310777127 2 0.4998206436845343 在群體中,你通常是提出意見的人還是配合的人? +16 做自己 9.922316606376546 -8.305942977639619 -4.0086075004321176 3 0.5306726929312431 在公共場所,你覺得自己有多少程度能呈現真實的樣貌?