Blender_bevy_components_wor.../tools/bevy_components/TODO.md
2024-05-05 22:18:16 +02:00

10 KiB

Basics

  • add panel

  • add a "create blueprint" button

    • when clicked:
      • create collection
      • add an empty inside collection and name it <COLLECTION_NAME>_components
      • add a AutoExport Boolean property to collection
      • add name imput(popup for name input ?)
  • add a list of existing components/custom properties

  • add an "edit blueprint" section

    • only filled when there is ONE selection, and that selection is a collection
    • add a dropdown of possible components
    • add a checkbox for enabling disabling a component (enabled by default)
    • add a button for copying a component
    • add a button for pasting a component

UI:

  • filterable list of components to DISPLAY for selection : ComponentDefinitionsList

  • Filter out invalid objects for components that have no _components suffix ? (that is too limiting I think)

  • -[x] How to deal with pre-existing custom properties that have NO metadata

    • if there is one without metadata: find if there is an available component with the same name & type ?
    • if there is , insert metadata
    • otherwise, mark it in some way visually ?
  • for OBJECT enums: add two ui pieces

    • one for selecting the TYPE to choose (ie normal enum)
    • one for setting the VALUE inside that
  • vecs => (not vec2, vec3 etc) more complex UI to add items in a list

    • generate contained CollectionGroup
    • CollectionProperty => type = the above
  • find ways to "collapse" the different levels of nested data of structs/tupples into a single custom property (ideally on the fly, but we can do without)

  • for single tupple components that represent a single unit type, re_use the base type's UIPropertyGroup instead of creating specific ones (ie TuppleTestF32_ui...) => will not work, would cause overriden "update callback"

  • pre_generate default values/values for each main type

  • fix issues with vec2 etc not having the correct number of items

  • fix bad defaults in ui group

  • fix object enums handling on updates (??)

  • fix issues with lambads in loops

  • object enum should be (params) ie *Collider: * Cuboid(Vec3) * Sphere(radius)

  • deal with enums variants that do not have any data: ex { "long_name": "Mesh" }

  • remove / change use of ComponentDefinitionsList

    • when filling the list, use the long_name as index ie items.append((str(index), item.name, item.long_name)) => items.append((item.long_name, item.name, item.long_name))
  • when removing a component, reset the value of the attribute in the property group (or not ? could be a feature)

  • deal correctly with fields of types that are NOT in the schema.json (for ex PlayingAnimation in AnimationPlayer)

  • deal correctly with complex types CascadeShadowConfig: has an array/list ClusterConfig: one of the enum variants is an object

  • possibly allow Color to be an enum as it should be ?

  • for sub items , the update functions "Name" should be the one of the root object

  • fix copy & pasting

    • it actually works, but the value of the custom property are not copied back to the UI, need to implement property_group_value_from_custom_property_value
  • we need a notion of "root propertyGroup" =?

  • notify user of missing entries in schema (ie , unregistered data types)

  • clarify propgroup_ui vs named nested fields

  • fix basic enums handling

  • add a list of not found components to the registry, add to them on the fly

  • add configuration panel (open the first time, closed on further user once configured)

  • add limits to ixxx types vs utypes

  • only display the "generate components xx" when relevant ie:

    • go through list of custom properties in current object
      • if one does not have metadata and / or propgroup: break
  • remove custom property of disabled component ? => NOpe, as we need custom properties to iterate over

  • what to do with components with n/a fields ? perhaps disable the component ? add a "invalid" field to meta ?

  • format output as correct RON

    • fix issue with empty strings
  • change custom property => propGroup to convert RON => Json first => obsolete

  • cleanup process_lists

  • fix issues with enum variants with only a long_name

  • display single item enums inline, others in a seperate row

  • add button to "apply all" (in configuration), to apply/update all custom properties to ALL objects where relevant

  • add button to "apply to current" to do the same with current

  • add warning sign to the above

  • what about metadata ?

  • only upgrade custom properties to metadata when asked/relevant

  • implement move list up/down

  • change property_group_value_from_custom_property_value => just disregard it for now, its point is very limited (helping people with old custom properties by attempting to generate real values) and give the change to a real ron format, it is too limiting

  • fix reload registry clearing list of missing types

  • clean up metadata module, a lot of repeated code

  • some fields when original is 0 or 0.0 are not copyable ? (seems like a bad boolean check )

  • fix issues with object variants in enums (see clusterconfig)

  • perhaps directly export default values within the schema.json ? - for most types , it is straighforward, but others, not so much: like the default color in Bevy , etc

  • change default schema.json to registry.json

  • pasted components do not get updated value in custom_property

  • finish documentation

  • add storage of registry path

    • save after setting the data (browse for)
    • load after each reload ?

Additional

- [x] check if output "string" in custom properties are correct

- gltf_auto_export
    - [x] add support for "enabled" flag
    - [ ] add special components 
            - "AutoExport" => Needed
            - "Dynamic" ? naah wait that should be exported by the Bevy side
    - [x] filter out Components_meta ??
    - [x] add legacy mode to the persisted parameters

- bevy_gltf_components:
    - [x] first release patch for current issues
    - [x] make configurable 
    - [x] add "compatibility mode" and deprecation warnings for the current hack-ish conversion of fake ron
    - [x] update docs to show we need to use ComponentsFromGltfPlugin::default

- bevy_gltf_blueprints
    - [x] update dependency
    - [x] update version
    - [x] add ability to set legacy mode for bevy_gltf_components ? 

- [x] release all versions
- [x] update main documentation, add compatibility version grid

Phase 2

  • fix handling of long component names

    • fix nesting level handling issue for new system : ie basic component DOES NOT work, but nestedLevel2 does
    • add goddam tests !
    • verify some weird prop => custom property values (Calculated Clip for example)
  • fix "reload registry" not clearing all previous data (reloading registry does not seem to account for added/removed components in the registry )

  • add file watcher for registry

    • have the watcher work as expected
    • add handling of removed registry file
    • clear & reset handler when the file browser for the registry is used
  • re-enable watcher

  • tests clear && pytest -svv --blender-executable <path_to_blender>/blender/blender-4.0.2-linux-x64/blender

    • load registry

    • just check list of components vs lists in registry

    • try adding all components

      • select an object
      • call the add_component operator
    • change params

      • use field names + component definitions to set values
      • find a way to shuffle params of ALL components based on a reliable, repeatable seed
    • test propgroup values => custom property values

    • test custom property value => propgroup value

    • check if all went well

  • fix issues with incorect custom_property generation

    • fix issue with object variants for enums
  • add handling for core::ops::Range & other ranges

  • add handling for alloc::borrow::Cow

  • add handling of isize

  • indirection level

    • currently

      • short_name +_"ui => direct lookup
      • problem : max 64 chars for propertyGroupNames
    • possible solution

      • propertyGroupName storage: simple , incremented INT (call it propGroupId for ex)
      • lookup shortName => propGroupId
    • do a first pass, by replacing manual propGroupNames creation with a function

    • in a second pass, replace the innards

  • add button to regenerate cutom prop values from custom properties (allows us to sidestep any future issues with internals changing)

    • fix lists
    • fix enums (see Clusterconfig)
      • need an example with one tupple one struct
      • projection
      • additionalmassproperties
    • fix tupleStructs (see TupleVecF32F32) => always the same problem of having us pre-parse data without knowing what we have inside
      • find a way to only split by level 0 (highest level) nesting "," seperators, ignoring any level of nesting until we dig one level deeper
      • solve nesting level use issues
  • remove metadata when deleting components

  • add try catch around custom_prop => propGroup

  • enhance the GenerateComponent_From_custom_property_Operator to use the new system to actually generate the stuff

  • coherence in operators:

    • component_name vs component_type
    • delete => remove
  • clean up reloading of registry settings

  • clean up file watcher

========================================= Restructuring of storage of components

  • marking of invalid root propgroups/components should be based on long name

  • overhaul & check each prop group type's use of short names => long names

    • lists
  • property_name = short_name in process enum: will likely require to use another indirection helper to keep the propery names short

  • in conversions from propgroups component_name = definition["short_name"]

  • fix is_component_valid that is used in gltf_auto_export

  • Hashmap Support

    • fix parsing of keys's type either on Bevy side (prefered, unlikely to be possible) or on the Blender side
    • handle missing types in registry for keys & values