Viewing 4 posts
  • #44823
    Gabor Illes
    Participant
    Posts: 2
    Threads: 3
    Joined: Mar 2025
    Up
    0
    Down
    ::

      Helló, szeretnék importálni egy kategóriarendszert egy txt fájl alapján. Amelyben az eszköz neve van írva, és milyen címkék tartoznak hozzá, például Bed.max – Hálószoba / szürke / ikea. Minden max. fájlhoz van egy ilyen listám. Tudnál adni egy szkriptet, amely létrehozza a kategóriákat és behelyezi az eszközöket. Megpróbáltam az API dokumentációjával szkriptet írni a chatgpt-vel, de nem sikerült. Sok eszközöm van, és szeretném automatizálni a kategória létrehozását. Szerintem ennek legjobb módja, ha egy külső adatbázist csatolunk a maximális fájlnévhez. Köszönjük a segítséget és a tanácsot.

  • #44827
    Posts: 263
    Threads: 1210
    Joined: Aug 2009

      Hello,

      Please prepare a brief technical specification and include a few sample TXT files showing your asset names with their tags.
      Once I have those, I can review everything and provide you with a cost estimate.

      You can send the details and samples to support@3d-kstudio.com.

  • #44828
    Gabor Illes
    Participant
    Posts: 2
    Threads: 3
    Joined: Mar 2025

      <h6>it would not contain any extras, just the file location and the categories or tags listed:</h6>
      <h6><span style=””>#(“j:\\_ASSETT_LIBRARY_\\Dimensiva\\Accessesories\\Artworks & Decoration\\Arch Steel Sculpture by Kristina Dam Studio-V-Ray.max”, “Bad\\Ikea\\Grey”),
      #(“j:\\_ASSETT_LIBRARY_\\Dimensiva\\Accessesories\\Artworks & Decoration\\Art Lines Artwork Wall Decor by Boconcept-V-Ray.max”, “Furniture\\Dining\\Wood”)</span></h6>
      I think the fastest solution is to use an image recognition AI to generate a database of which tags belong to which max file, then I run this script inside the manga and it automatically arranges the assets. I wrote a script but it only arranges the files into categories, they don’t get tags and so they can’t be searched. It would be enough if you could tell me how to complete my script

       

      /* ———— Konfiguráció ———— */
      local assets = #(
      #(“j:\\_ASSETT_LIBRARY_\\Dimensiva\\Accesories\\Artworks & Decoration\\Arch Steel Sculpture by Kristina Dam Studio-V-Ray.max”, “Bad\\Ikea\\Grey”),
      #(“j:\\_ASSETT_LIBRARY_\\Dimensiva\\Accesories\\Artworks & Decoration\\Art Lines Artwork Wall Decor by Boconcept-V-Ray.max”, “Furniture\\Dining\\Wood”)
      )

      local section = #Models — vagy #Materials, #Textures, stb.

      /* ———— Segédfüggvény: kategória létrehozás ———— */
      fn getOrCreateCategory pathString section =
      (
      local parts = filterString pathString “\\”
      local parentID = 0

      for p in parts do
      (
      local name = trimLeft (trimRight p)
      local existing = KstudioManagerCategoryAPI.GetCategories name section
      local found = undefined

      for cat in existing do (
      if cat.name == name and cat.getParent() != undefined and cat.getParent().id == parentID do (
      found = cat
      exit
      )
      )

      if found == undefined then
      (
      local newCat = KstudioManagerCategoryAPI.AddCategory name parentID section
      if newCat != undefined then parentID = newCat.ID
      )
      else (
      parentID = found.ID
      )
      )

      return parentID
      )

      /* ———— Fő logika: assetek betöltése és kategorizálása ———— */
      for item in assets do
      (
      local filepath = item[1]
      local catPath = item[2]
      local catID = getOrCreateCategory catPath section

      /* Hozzárendeljük az assetet a kategóriához */
      if doesFileExist filepath do
      (
      local result = KstudioManagerCategoryAPI.AssignCategory catID #(filepath) section
      if result then
      format “✅ Hozzárendelve: % → %\n” filepath catPath
      else
      format “❌ Sikertelen hozzárendelés: %\n” filepath
      )
      )

  • #44829
    Gabor Illes
    Participant
    Posts: 2
    Threads: 3
    Joined: Mar 2025

Viewing 4 posts

You must be logged in to reply to this topic.