venomgfx / amaranth Goto Github PK
View Code? Open in Web Editor NEWRepository for Amaranth, Blender Addon and Theme
Home Page: pablovazquez.org/amaranth
Repository for Amaranth, Blender Addon and Theme
Home Page: pablovazquez.org/amaranth
How to produce this bug:
It happen on latest trunk release.
When I try to enable the add-on I get the following traceback:
Traceback (most recent call last):
File "/home/attila/programs/blender-2.78a-linux-glibc211-x86_64/2.78/scripts/modules/addon_utils.py", line 349, in enable
mod.register()
File "/home/attila/.config/blender/2.78/scripts/addons/amaranth/__init__.py", line 118, in register
_call_globals("register")
File "/home/attila/.config/blender/2.78/scripts/addons/amaranth/__init__.py", line 107, in _call_globals
getattr(m, attr_name)()
File "/home/attila/.config/blender/2.78/scripts/addons/amaranth/misc/color_management.py", line 76, in register
bpy.utils.register_class(AMTH_AddPresetColorManagement)
ValueError: register_class(...): already registered as a subclass
And when I open up the preferences window I get the following traceback in the terminal as Blender's stderror:
File "/home/attila/programs/blender-2.78a-linux-glibc211-x86_64/2.78/scripts/modules/bpy_types.py", line 673, in draw_ls
func(self, context)
File "/home/attila/.config/blender/2.78/scripts/addons/amaranth/render/remember_layers.py", line 211, in ui_layers_for_render_header
preferences = context.user_preferences.addons["amaranth"].preferences
KeyError: 'bpy_prop_collection[key]: key "amaranth" not found'
I use Gentoo Linux with vanilla Blender 2.78 downloaded from blender.org, amaranth was installed as described in the README.md.
When bpy.context.space_data.lock_camera_and_layers == False
and the selected object is not on the scene layer trying to Remove Unassigned materials returns:
Traceback (most recent call last):
File "/home/gabriel/.config/blender/2.77/scripts/addons/amaranth/scene/material_remove_unassigned.py", line 51, in execute
bpy.ops.mesh.select_all(action="DESELECT")
File "/home/gabriel/Documentos/SoftLibre/Blender/blender-2.77-linux-glibc211-x86_64/2.77/scripts/modules/bpy/ops.py", line 189, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.mesh.select_all.poll() failed, context is incorrect
location: <unknown location>:-1
Always nice to use this addon. I hardly know what is Blender Vanilla and what is from this addon. Remember when i started using 2.80 that i was missing it so i started porting it, someone beat me to it. Though i still prefer the older method of the missing links. Think im going to revert that again. Anyways...
I was noticing that curves didnt do anything when settings are saved. I remembered an addon where i also implemented a curve so i knew the data of those points can be reached. Then started to thinker with the AddPresetBase function/operator.
I know got it working, it saves every curve which has been edited, 4 that is C,R,G,B it now also saves all the other settings which were missing.
ill make a fork and do a pull request. I tried to keep the code as clean as i could. Im no pro dev, so perhaps lots of my code can be simplified, but it works thats good for me
https://user-images.githubusercontent.com/6923008/113667093-4bff4b80-967e-11eb-9fe3-e49b94b73b7d.mp4
This is what a file looked prior
import bpy
scene = bpy.context.scene
scene.view_settings.view_transform = 'Filmic'
scene.display_settings.display_device = 'sRGB'
scene.view_settings.exposure = 0.0
scene.view_settings.gamma = 1.0
scene.view_settings.look = 'Low Contrast'
scene.view_settings.use_curve_mapping = True
scene.sequencer_colorspace_settings.name = 'sRGB'
This is how it looks now with saved curves settings. I could perhaps better use a DICT but im not really at home with those. Ill try to do some more research, could save a lot of lines
import bpy
scene = bpy.context.scene
view = scene.view_settings
cm = view.curve_mapping
# Dirty delete < 2.92 doesnt have operator
if bpy.app.version <= (2,93):
for l in range(len(cm.curves)):
totCpts = len(cm.curves[l].points)
#First delete all export first and list
if totCpts > 2:
for i in range(1,totCpts-1):
cm.initialize()
cm.update()
newIdx = len(cm.curves[l].points)
cm.curves[l].points.remove(cm.curves[l].points[(newIdx-2)])
#Reset first and last to 0,0 and 1,1
resetLst = [(0.0,0.0),(1.0,1.0)]
for i in range(2):
cm.initialize()
cm.update()
cm.curves[l].points[i].location=resetLst[i]
cm.update()
rPtsList=[(0.0, 0.0), (1.0, 1.0)]
for i in range(2):
# Update first and last > dont add new
if i == 0 or i == (len(rPtsList)-1):
cm.curves[0].points[i].location=rPtsList[i]
else:
cm.curves[0].points.new(float(rPtsList[i][0]),float(rPtsList[i][1]))
gPtsList=[(0.0, 0.0), (1.0, 1.0)]
for i in range(2):
# Update first and last > dont add new
if i == 0 or i == (len(gPtsList)-1):
cm.curves[1].points[i].location=gPtsList[i]
else:
cm.curves[1].points.new(float(gPtsList[i][0]),float(gPtsList[i][1]))
bPtsList=[(0.0, 0.0), (1.0, 1.0)]
for i in range(2):
# Update first and last > dont add new
if i == 0 or i == (len(bPtsList)-1):
cm.curves[2].points[i].location=bPtsList[i]
else:
cm.curves[2].points.new(float(bPtsList[i][0]),float(bPtsList[i][1]))
cPtsList=[(0.17073175311088562, 0.49999988079071045), (0.4668988585472107, 0.2312503159046173), (0.7665510177612305, 0.6562495827674866)]
for i in range(3):
# Update first and last > dont add new
if i == 0 or i == (len(cPtsList)-1):
cm.curves[3].points[i].location=cPtsList[i]
else:
cm.curves[3].points.new(float(cPtsList[i][0]),float(cPtsList[i][1]))
cm.black_level.hsv=(0.0, 0.0, 0.0)
cm.white_level.hsv=(0.0, 0.0, 1.0)
cm.clip_max_x=1.0
cm.clip_max_y=1.0
cm.clip_min_x=0.0
cm.clip_min_y=0.0
cm.update()
scene.view_settings.view_transform = 'Filmic'
scene.display_settings.display_device = 'sRGB'
scene.view_settings.exposure = 0.0
scene.view_settings.gamma = 1.0
scene.view_settings.look = 'None'
scene.view_settings.use_curve_mapping = True
scene.sequencer_colorspace_settings.name = 'sRGB'
I just noticed that the addon is not showing. I have checked all file, most seem to be ported properly. Some how its not showing in the list of addons.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.