New answers tagged

1

If I understood the problem correctly, you can use Getter / Setter functions to achieve your goal. import bpy def get_value(self): return bpy.context.active_object.location.x def set_value(self, value): bpy.context.active_object.location.x = value if __name__ == "__main__": bpy.types.Scene.someValue = bpy.props.FloatProperty(get=...


0

I've found an answer via from Detective bpy on the Blender Community Discord. They provided a link to this post: https://blender.stackexchange.com/a/239606 Which led me to this solution: import bpy def msgbus_callback(*arg): bpy.context.scene.someValue = bpy.context.selected_objects[0].location.x def subscribe_to_obj(): bpy.msgbus....


1

did you try out to press one of these buttons? They change the way objects will be shown in the viewport.


0

In the end, the answer is "You can't get there from here". More precisely, when you add an update function to a property in a class, Blender massages that property at registration time, in such a way that the context argument to the update function becomes the window manager, and not the context you need to look up the property. This is why the ...


3

It is not a bug. Floating point numbers are only accurate to about 8 decimals in Blender because it uses CPU single precision internally. Depending on what you mean by a lot you might want to investigate numpy which uses double precision internally.


0

Quaternion data-types need 4 float values while euler rotation data-types need only 3 values and the default size for FloatVectorProperty is 3 ; so together with subtype argument that should be set to QUATERNION we should also set the size argument to 4 and the field now holds a quaternion data-type.


0

It is because localUpdate is an instance method. localString is a class annotation adding a property to all instances but at the time is defined, instance methods are not yet registered in the class. (At least that's my guess) So you have to move localUpdate out of the class definition : This works : import bpy from bpy.types import Operator, Panel from bpy....


0

Although i am not the add-on-Pro....i think it is because you are showing the global variable field too. So it takes the value from that field. If you comment out # col.prop(context.scene, "globalString", text="Global") it works. But i am sure batfinger can explain this better ;)


0

I was not satisifed with the way the field is dimmed and the value can't be accessed in a color field when it is read-only. I added custom get and set methods to ensure the user can't modify it from the interface, while being able to click the field and copy the values inside the RGB widget. import bpy bpy.types.Object.my_prop = bpy.props....


5

If you have many unused materials, you can also assign them a 'fake user' in the outliner. In the Outliner, use the Orphan Data View, then in Materials, select what you want and either click on their 'shield' icons (on the right of the image below) or right click the material and choose 'Add fake user'.


4

Press on the shield icon in order to make sure that your material (or any other data) is safe. The name of the material will then be preceded by the letter "F" like "Fake User". As long as the name is preceded by "0" it means that the data has no user and that it will be lost when you'll close the file:


Top 50 recent answers are included