#Skein - Rafactored code

11 messages · Page 1 of 1 (latest)

deft geode
#

Hello I’m using the Skein plugin and it works well for what I need if I use a single main.rs file.

However, when triying to put the register component outside of main.rs and put everything in a game plugin. The reflect/registered components are not recognized anymore in my gltf import.

Is it a know issue ? What is the minimum setup I should have in main.rs ?

solar owl
#

if you have a component on main.rs and move it to component.rs, the path on the registry changes and skein cant find it

#

let's say you crate is called my_crate and you have a component MyComponent on it, when registering it, it will have the path my_crate::MyComponent

#

if you move MyComponent to a module called my_module under main.rs the path now becames my_crate::my_module::MyComponent

#

if you exported the gltf when it was my_crate::MyComponent and is trying to open it on the moved codebase, it will complain that it can't find my_crate::MyComponent

#

then you need to reexport the gltf with the updated registry

deft geode
#

OK thank you, indeed I had to reassign every Component manually in Blender. All good now 🙂

solar owl
#

if there is nothing else, edit the tags of the post to include resolved

fierce jacinth
#

seeing this a bit late, but you can set the type path and type name for components so that the API you see in Blender always looks the same even if you rename/move them. this will show up as api::Something in Blender no matter where it is in your source code:

#[derive(Component, Reflect, Debug)]
#[reflect(Component)]
#[type_path = "api"]
#[type_name = "Something"]
struct Character {
    name: String,
}
solar owl
fierce jacinth