trynyty / Rigify_DeformBones

Rigify script for changing deformation bones to make it compatible with Unity Mecanim
76 stars 23 forks source link

"myapply_tr" not found #1

Closed jomo0825 closed 7 years ago

jomo0825 commented 7 years ago

Many thanks for your efforts, and this is by far the most simplest way to import blender human model I've ever seen! When I tried to use <Export to .fbx file> in my own project scene, it gives me some warning like: "myapply_tr" not found (line 105). And I found that there are some Custom Properties in your demo file which I do not have in mine, like: "beta_pose_rig4mec_test.blend" like cycles, myapply_tr, smd_export_list.

Do I need to add these parameters by my own? Thx!!

trynyty commented 7 years ago

Hi Jomo, first of all, thank you :)

About my file... it was an older file which I had when I tried it first time, but I tried it now and there is no problem on my side. I'm using the addon on all of my characters(different blend files) as it's faster to configure them correctly and export them easily and so far I did not have such problems. So I want to ask you, what version of Blender are you using?

Some explanation... I'm not sure about other properties, but for "myapply_tr" is a bool property, which I'm using to set EXPERIMENTAL feature 'Apply Transform' when exporting. You can turn it on or off when doing export from the addon...

The thing is, I'm not quite sure how are you using it. Can you see the panel like this? rig4mec_panel The Apply Transform checkbox is the actual "myapply_tr" property.

Also, when I do the export into fbx file from that panel, I can put it into Unity without problems... no warning messages... so can you maybe send me some screenshots of the messages and where are you getting them? Thanks for your feedback.

trynyty commented 7 years ago

One more thing, which I've forgot.

Don't you get Reload Trusted warning messages, which is causing the script to not work correctly? It looks like this: reload_trusted

I'm turning on the Auto Run Python scripts option, so I don't get them for scripts... It will bypass the trusted source check, which might cause this problem. You can set it here: autorun_python

However, I'm not sure if this is your case... just a thing that comes to my mind...

jomo0825 commented 7 years ago

Hi, I've uploaded my screen record here: http://www.memoryabc.com/download/Blender.wmv I just started a new project in Blender v2.78, and made a simple cubic man + Armature, and then started screen recording.

I can follow your example perfectly. And import the output fbx to Unity5. But when I tried to start a new cubic man project, it shows like the screen record attached in above link.

I've turned on and there is no warning popups...

trynyty commented 7 years ago

Oh, I see now... To be honest I'm not 100% sure... there was a time when I hit similar error with myApplyTr and not sure if I didn't put it on git accidentally... I will check it when I come home from work (I have there current version of Blender)... I let you know about it later this day.

trynyty commented 7 years ago

So I've changed the properties from context.scene to context.object. Now those properties should be stored on each object separately (I guess it's probably better approach than prior version).

What the problem actually was, is a bit funny. The thing is that those properties are not defined when you do not access them. So when you left the Apply Transform as is, the property is not set on the Scene scope. The export code then couldn't find it and was getting error. The reason why I had it in my files is that I set it on and off lot of times (wanted to see the differences).

I'm not too knowledgeable about blender python addon scripting, so I'm not sure if my current approach is ok or if it might cause some other problems. However, I tried it and it works (even if the property is not set in the object, or it is not visible) so I hope it will work in your projects too.

Thanks for pointing me to the bug :) it really helps.

good luck with your projects ;)

jomo0825 commented 7 years ago

@trynyty Thank you so much! It works now~~ :)

trynyty commented 7 years ago

You are welcome ;)