Is it possible to make some operatoins on curve without entering edit mode?

I am using small code in Animation Nodes:

bpy.context.scene.objects.active = obj
obj.select = True

I am using many small scripts in Animation Nodes, and each time i have to take care if object is selected and context is correct.

Is it possible to use .remove without all previous lines? like this:remove(obj, splines)

| improve this question | | | | |
  • $\begingroup$ What is the need to bpy.ops.xxx and not simply use remove? Is there something due to AN in that? $\endgroup$ – lemon Apr 27 '17 at 10:59
  • $\begingroup$ I don't know. remove(obj.data.splines[0]) AN says "name 'remove' is not defined" $\endgroup$ – fomaamof Apr 27 '17 at 11:41
  • $\begingroup$ But obj.data.splines.remove(obj.data.splines[0]) should work without using bpy.ops before. You should provide more details about your node setting and the way the parameters are given to it $\endgroup$ – lemon Apr 27 '17 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.